diff options
author | Kushal Pandya <kushal@gitlab.com> | 2018-06-28 09:41:56 +0300 |
---|---|---|
committer | Kushal Pandya <kushal@gitlab.com> | 2018-07-02 12:39:37 +0300 |
commit | ffe7c511c2edb4d0a4862aab963de32c05e77fed (patch) | |
tree | b5166c3a8fec5c024cc16b9c0e6a2ddbe0afd926 /app/assets/javascripts/gl_form.js | |
parent | 3c0ff4ddb9a910a2da0472cfc6ced745a421a623 (diff) |
Add `&` support for epics autocompletion
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r-- | app/assets/javascripts/gl_form.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js index f802971a3ca..c74de7ac34d 100644 --- a/app/assets/javascripts/gl_form.js +++ b/app/assets/javascripts/gl_form.js @@ -9,6 +9,13 @@ export default class GLForm { this.form = form; this.textarea = this.form.find('textarea.js-gfm-input'); this.enableGFM = Object.assign({}, GFMConfig.defaultAutocompleteConfig, enableGFM); + // Disable autocomplete for keywords which do not have dataSources available + const dataSources = (gl.GfmAutoComplete && gl.GfmAutoComplete.dataSources) || {}; + Object.keys(this.enableGFM).forEach(item => { + if (item !== 'emojis') { + this.enableGFM[item] = !!dataSources[item]; + } + }); // Before we start, we should clean up any previous data for this form this.destroy(); // Setup the form |