diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 15:06:27 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-18 15:06:27 +0000 |
commit | 466b97a108b1d1fe2a0d66d40561e0f5cc197daa (patch) | |
tree | 76c497ac35d3774a6dc58710b1f72f36c5dc7821 /app/assets/javascripts/search_autocomplete.js | |
parent | 16d9f66e9651d35b52e5a167789befe7b861292c (diff) | |
download | gitlab-ce-466b97a108b1d1fe2a0d66d40561e0f5cc197daa.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/search_autocomplete.js')
-rw-r--r-- | app/assets/javascripts/search_autocomplete.js | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/app/assets/javascripts/search_autocomplete.js b/app/assets/javascripts/search_autocomplete.js index 57bf9a2d233..8d888a574d8 100644 --- a/app/assets/javascripts/search_autocomplete.js +++ b/app/assets/javascripts/search_autocomplete.js @@ -1,4 +1,4 @@ -/* eslint-disable no-return-assign, one-var, no-var, consistent-return, class-methods-use-this, vars-on-top */ +/* eslint-disable no-return-assign, consistent-return, class-methods-use-this */ import $ from 'jquery'; import { escape, throttle } from 'underscore'; @@ -29,14 +29,14 @@ const KEYCODE = { }; function setSearchOptions() { - var $projectOptionsDataEl = $('.js-search-project-options'); - var $groupOptionsDataEl = $('.js-search-group-options'); - var $dashboardOptionsDataEl = $('.js-search-dashboard-options'); + const $projectOptionsDataEl = $('.js-search-project-options'); + const $groupOptionsDataEl = $('.js-search-group-options'); + const $dashboardOptionsDataEl = $('.js-search-dashboard-options'); if ($projectOptionsDataEl.length) { gl.projectOptions = gl.projectOptions || {}; - var projectPath = $projectOptionsDataEl.data('projectPath'); + const projectPath = $projectOptionsDataEl.data('projectPath'); gl.projectOptions[projectPath] = { name: $projectOptionsDataEl.data('name'), @@ -49,7 +49,7 @@ function setSearchOptions() { if ($groupOptionsDataEl.length) { gl.groupOptions = gl.groupOptions || {}; - var groupPath = $groupOptionsDataEl.data('groupPath'); + const groupPath = $groupOptionsDataEl.data('groupPath'); gl.groupOptions[groupPath] = { name: $groupOptionsDataEl.data('name'), @@ -387,20 +387,18 @@ export class SearchAutocomplete { } restoreOriginalState() { - var i, input, inputs, len; - inputs = Object.keys(this.originalState); - for (i = 0, len = inputs.length; i < len; i += 1) { - input = inputs[i]; + const inputs = Object.keys(this.originalState); + for (let i = 0, len = inputs.length; i < len; i += 1) { + const input = inputs[i]; this.getElement(`#${input}`).val(this.originalState[input]); } } resetSearchState() { - var i, input, inputs, len, results; - inputs = Object.keys(this.originalState); - results = []; - for (i = 0, len = inputs.length; i < len; i += 1) { - input = inputs[i]; + const inputs = Object.keys(this.originalState); + const results = []; + for (let i = 0, len = inputs.length; i < len; i += 1) { + const input = inputs[i]; results.push(this.getElement(`#${input}`).val('')); } return results; @@ -415,8 +413,7 @@ export class SearchAutocomplete { } restoreMenu() { - var html; - html = `<ul><li class="dropdown-menu-empty-item"><a>${__('Loading...')}</a></li></ul>`; + const html = `<ul><li class="dropdown-menu-empty-item"><a>${__('Loading...')}</a></li></ul>`; return this.dropdownContent.html(html); } |