summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-06-26 17:10:18 +0200
committerFatih Acet <acetfatih@gmail.com>2018-06-26 17:54:35 +0200
commitc622252bd842af205bf32e3c2c173ada80cb0f41 (patch)
tree8f5e974a6e65160ccd4bb286eb026c0c222a758e
parent13a8ad61b2cc37cf65f482bfa6855d8e2060a554 (diff)
downloadgitlab-ce-c622252bd842af205bf32e3c2c173ada80cb0f41.tar.gz
Use refs instead of querySelector.
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_note_form.vue4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
index e2d8825b2af..6943b462e86 100644
--- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
@@ -44,7 +44,6 @@ export default {
},
mounted() {
if (this.isLoggedIn) {
- const textarea = this.$el.querySelector('.js-note-text');
const noteableData = this.getNoteableData;
const keys = [
NOTE_TYPE,
@@ -56,7 +55,7 @@ export default {
this.line.lineCode,
];
- this.autosave = new Autosave($(textarea), keys);
+ this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), keys);
}
},
methods: {
@@ -103,6 +102,7 @@ export default {
class="content discussion-form discussion-form-container discussion-notes"
>
<note-form
+ ref="noteForm"
:is-editing="true"
:line-code="line.lineCode"
save-button-title="Comment"