Commit c433f520 authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Remove usage of global scope and remove dom querying from issue note form

parent b27fb233
...@@ -28,11 +28,13 @@ ...@@ -28,11 +28,13 @@
}, },
}, },
data() { data() {
const { getIssueData, getNotesData } = this.$store.getters;
return { return {
initialNote: this.noteBody, initialNote: this.noteBody,
note: this.noteBody, note: this.noteBody,
markdownPreviewUrl: gl.issueData.preview_note_path, markdownPreviewUrl: getIssueData.preview_note_path,
markdownDocsUrl: '', markdownDocsUrl: getNotesData.markdownDocs,
conflictWhileEditing: false, conflictWhileEditing: false,
}; };
}, },
...@@ -67,10 +69,6 @@ ...@@ -67,10 +69,6 @@
}, },
}, },
mounted() { mounted() {
const issuableDataEl = document.getElementById('js-issuable-app-initial-data');
const issueData = JSON.parse(issuableDataEl.innerHTML.replace(/"/g, '"'));
this.markdownDocsUrl = issueData.markdownDocs;
this.$refs.textarea.focus(); this.$refs.textarea.focus();
}, },
watch: { watch: {
...@@ -126,7 +124,7 @@ ...@@ -126,7 +124,7 @@
{{saveButtonTitle}} {{saveButtonTitle}}
</button> </button>
<button <button
@click="cancelHandler()" @click="cancelHandler"
class="btn btn-nr btn-cancel note-edit-cancel" class="btn btn-nr btn-cancel note-edit-cancel"
type="button"> type="button">
Cancel Cancel
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment