summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/gl_form.js
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-05-16 18:42:06 +0000
committerClement Ho <clemmakesapps@gmail.com>2017-05-16 18:42:06 +0000
commitb8b6de4c759ba85caaf7ff4ea26abceeba23bcf4 (patch)
tree4665f19d1180e2c72e40dd8fc6a053fd26a56976 /app/assets/javascripts/gl_form.js
parentdc045dab8f41cdd580268837bac41277a2290b40 (diff)
downloadgitlab-ce-b8b6de4c759ba85caaf7ff4ea26abceeba23bcf4.tar.gz
Make `gfm_auto_complete` into a module and fix up tech debt
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r--app/assets/javascripts/gl_form.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js
index ff06092e4d6..51822f21e66 100644
--- a/app/assets/javascripts/gl_form.js
+++ b/app/assets/javascripts/gl_form.js
@@ -3,6 +3,8 @@
/* global DropzoneInput */
/* global autosize */
+import GfmAutoComplete from './gfm_auto_complete';
+
window.gl = window.gl || {};
function GLForm(form) {
@@ -31,7 +33,7 @@ GLForm.prototype.setupForm = function() {
// 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'));
- gl.GfmAutoComplete.setup(this.form.find('.js-gfm-input'));
+ new GfmAutoComplete(gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources).setup(this.form.find('.js-gfm-input'));
new DropzoneInput(this.form);
autosize(this.textarea);
}