summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/gl_form.js
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-06-29 15:28:12 +0000
committerPhil Hughes <me@iamphill.com>2017-06-29 15:28:12 +0000
commit29d8b3701fa86e0a18e2f1c0516315346ba2e4cb (patch)
tree1da200f8278347b93385a5e3761567c5d543fe9a /app/assets/javascripts/gl_form.js
parenteb77e6384c142b6a054971e28a4938bba9834fe1 (diff)
downloadgitlab-ce-29d8b3701fa86e0a18e2f1c0516315346ba2e4cb.tar.gz
Resolve "Issue dropdown persists when adding issue number to issue description"
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r--app/assets/javascripts/gl_form.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js
index dc9f114af99..4e8141b2956 100644
--- a/app/assets/javascripts/gl_form.js
+++ b/app/assets/javascripts/gl_form.js
@@ -21,6 +21,9 @@ function GLForm(form, enableGFM = false) {
GLForm.prototype.destroy = function() {
// Clean form listeners
this.clearEventListeners();
+ if (this.autoComplete) {
+ this.autoComplete.destroy();
+ }
return this.form.data('gl-form', null);
};
@@ -33,7 +36,8 @@ GLForm.prototype.setupForm = function() {
this.form.addClass('gfm-form');
// remove notify commit author checkbox for non-commit notes
gl.utils.disableButtonIfEmptyField(this.form.find('.js-note-text'), this.form.find('.js-comment-button, .js-note-new-discussion'));
- new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources).setup(this.form.find('.js-gfm-input'), {
+ this.autoComplete = new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources);
+ this.autoComplete.setup(this.form.find('.js-gfm-input'), {
emojis: true,
members: this.enableGFM,
issues: this.enableGFM,