Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Davila <rdavila84@gmail.com>2016-09-09 18:39:22 +0300
committerRuben Davila <rdavila84@gmail.com>2016-09-09 18:39:22 +0300
commit2cad277d74b6a7367ac11b94652a6efc18eda850 (patch)
treec3720b686e5d556f46d1c09f9b30b073966d7c48 /app/assets/javascripts/gl_form.js
parente36534dbd2045df23d12627f15c64f6dc523149b (diff)
parent2b3a1da6f3ceb4c78c055f14dfe93dbe818366d3 (diff)
Merge branch 'master' into 8-12-stable
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r--app/assets/javascripts/gl_form.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js
index 528a673eb15..2703adc0705 100644
--- a/app/assets/javascripts/gl_form.js
+++ b/app/assets/javascripts/gl_form.js
@@ -3,12 +3,15 @@
function GLForm(form) {
this.form = form;
this.textarea = this.form.find('textarea.js-gfm-input');
+ // Before we start, we should clean up any previous data for this form
this.destroy();
+ // Setup the form
this.setupForm();
this.form.data('gl-form', this);
}
GLForm.prototype.destroy = function() {
+ // Clean form listeners
this.clearEventListeners();
return this.form.data('gl-form', null);
};
@@ -21,12 +24,15 @@
this.form.find('.div-dropzone').remove();
this.form.addClass('gfm-form');
disableButtonIfEmptyField(this.form.find('.js-note-text'), this.form.find('.js-comment-button'));
+ // remove notify commit author checkbox for non-commit notes
GitLab.GfmAutoComplete.setup(this.form.find('.js-gfm-input'));
new DropzoneInput(this.form);
autosize(this.textarea);
+ // form and textarea event listeners
this.addEventListeners();
gl.text.init(this.form);
}
+ // hide discard button
this.form.find('.js-note-discard').hide();
return this.form.show();
};