diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-03-19 14:37:48 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-03-19 12:34:30 -0500 |
commit | 7048109c6b39b7de750f45b34ecf7471b43b1c31 (patch) | |
tree | 16b9dce33bc424401ddb53540f49215033979067 | |
parent | 296040c0491c8fd3083c39f8ccc8631413e3204d (diff) | |
download | gitlab-ce-7048109c6b39b7de750f45b34ecf7471b43b1c31.tar.gz |
Merge branch '43928-merge-request-comment-gets-cleared-once-the-previous-comment-is-submitted' into 'master'
Resolve "Notes karma specs failing"
Closes #44002
See merge request gitlab-org/gitlab-ce!17627
-rw-r--r-- | app/assets/javascripts/notes.js | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index c640003d958..750ed27873f 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -82,6 +82,9 @@ export default class Notes { this.basePollingInterval = 15000; this.maxPollingSteps = 4; + this.$wrapperEl = hasVueMRDiscussionsCookie() + ? $(document).find('.diffs') + : $(document); this.cleanBinding(); this.addBinding(); this.setPollingInterval(); @@ -106,8 +109,6 @@ export default class Notes { } addBinding() { - this.$wrapperEl = hasVueMRDiscussionsCookie() ? $(document).find('.diffs') : $(document); - // Edit note link this.$wrapperEl.on('click', '.js-note-edit', this.showEditForm.bind(this)); this.$wrapperEl.on('click', '.note-edit-cancel', this.cancelEdit); @@ -150,14 +151,9 @@ export default class Notes { $(window).on('hashchange', this.onHashChange); this.boundGetContent = this.getContent.bind(this); document.addEventListener('refreshLegacyNotes', this.boundGetContent); - this.eventsBound = true; } cleanBinding() { - if (!this.eventsBound) { - return; - } - this.$wrapperEl.off('click', '.js-note-edit'); this.$wrapperEl.off('click', '.note-edit-cancel'); this.$wrapperEl.off('click', '.js-note-delete'); |