Commit c622252b authored by Fatih Acet's avatar Fatih Acet

Use refs instead of querySelector.

parent 13a8ad61
...@@ -44,7 +44,6 @@ export default { ...@@ -44,7 +44,6 @@ export default {
}, },
mounted() { mounted() {
if (this.isLoggedIn) { if (this.isLoggedIn) {
const textarea = this.$el.querySelector('.js-note-text');
const noteableData = this.getNoteableData; const noteableData = this.getNoteableData;
const keys = [ const keys = [
NOTE_TYPE, NOTE_TYPE,
...@@ -56,7 +55,7 @@ export default { ...@@ -56,7 +55,7 @@ export default {
this.line.lineCode, this.line.lineCode,
]; ];
this.autosave = new Autosave($(textarea), keys); this.autosave = new Autosave($(this.$refs.noteForm.$refs.textarea), keys);
} }
}, },
methods: { methods: {
...@@ -103,6 +102,7 @@ export default { ...@@ -103,6 +102,7 @@ export default {
class="content discussion-form discussion-form-container discussion-notes" class="content discussion-form discussion-form-container discussion-notes"
> >
<note-form <note-form
ref="noteForm"
:is-editing="true" :is-editing="true"
:line-code="line.lineCode" :line-code="line.lineCode"
save-button-title="Comment" save-button-title="Comment"
......
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