diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-24 00:10:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-24 00:10:24 +0300 |
commit | 5838993b5f3e2d861d9dd7c82dfeea71506b9fc2 (patch) | |
tree | caab6621fb79f06a355f802dc885982f746b544d /app/assets/javascripts/deprecated_jquery_dropdown | |
parent | b8d021cb606ac86f41a0ef9dacd133a9677f8414 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/deprecated_jquery_dropdown')
4 files changed, 21 insertions, 21 deletions
diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js index 3d35ab2432f..99351231520 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js @@ -68,7 +68,7 @@ export class GitLabDropdown { this.remote = new GitLabDropdownRemote(this.options.data, { dataType: this.options.dataType, beforeSend: this.toggleLoading.bind(this), - success: data => { + success: (data) => { this.fullData = data; this.parseData(this.fullData); this.focusTextInput(); @@ -113,7 +113,7 @@ export class GitLabDropdown { return $(selector, this.dropdown); }, data: () => this.fullData, - callback: data => { + callback: (data) => { this.parseData(data); if (this.filterInput.val() !== '') { selector = SELECTABLE_CLASSES; @@ -135,13 +135,13 @@ export class GitLabDropdown { this.dropdown.on('hidden.bs.dropdown', this.hidden); $(this.el).on('update.label', this.updateLabel); this.dropdown.on('click', '.dropdown-menu, .dropdown-menu-close', this.shouldPropagate); - this.dropdown.on('keyup', e => { + this.dropdown.on('keyup', (e) => { // Escape key if (e.which === 27) { return $('.dropdown-menu-close', this.dropdown).trigger('click'); } }); - this.dropdown.on('blur', 'a', e => { + this.dropdown.on('blur', 'a', (e) => { let $dropdownMenu; let $relatedTarget; if (e.relatedTarget != null) { @@ -153,7 +153,7 @@ export class GitLabDropdown { } }); if (this.dropdown.find('.dropdown-toggle-page').length) { - this.dropdown.find('.dropdown-toggle-page, .dropdown-menu-back').on('click', e => { + this.dropdown.find('.dropdown-toggle-page, .dropdown-menu-back').on('click', (e) => { e.preventDefault(); e.stopPropagation(); return this.togglePage(); @@ -164,7 +164,7 @@ export class GitLabDropdown { if (this.dropdown.find('.dropdown-toggle-page').length) { selector = '.dropdown-page-one .dropdown-content a'; } - this.dropdown.on('click', selector, e => { + this.dropdown.on('click', selector, (e) => { const $el = $(e.currentTarget); const selected = self.rowClicked($el); const selectedObj = selected ? selected[0] : null; @@ -221,7 +221,7 @@ export class GitLabDropdown { else if (isObject(data)) { html = []; - Object.keys(data).forEach(name => { + Object.keys(data).forEach((name) => { groupData = data[name]; html.push( this.renderItem( @@ -232,7 +232,7 @@ export class GitLabDropdown { name, ), ); - this.renderData(groupData, name).map(item => html.push(item)); + this.renderData(groupData, name).map((item) => html.push(item)); }); } else { // Render each row @@ -271,7 +271,7 @@ export class GitLabDropdown { filteredFullData() { return this.fullData.filter( - r => + (r) => typeof r === 'object' && !Object.prototype.hasOwnProperty.call(r, 'beforeDivider') && !Object.prototype.hasOwnProperty.call(r, 'header'), @@ -389,7 +389,7 @@ export class GitLabDropdown { ...this.options, icon: this.icon, highlight: this.highlight, - highlightText: text => this.highlightTextMatches(text, this.filterInput.val()), + highlightText: (text) => this.highlightTextMatches(text, this.filterInput.val()), highlightTemplate: this.highlightTemplate.bind(this), parent, }, @@ -536,7 +536,7 @@ export class GitLabDropdown { } if (this.options.multiSelect) { - Object.keys(selectedObject).forEach(attribute => { + Object.keys(selectedObject).forEach((attribute) => { $input.attr(`data-${attribute}`, selectedObject[attribute]); }); } @@ -577,7 +577,7 @@ export class GitLabDropdown { if (this.dropdown.find('.dropdown-toggle-page').length) { selector = `.dropdown-page-one ${selector}`; } - return $('body').on('keydown', e => { + return $('body').on('keydown', (e) => { let $listItems; let PREV_INDEX; const currentKeyCode = e.which; diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js index 7b69a5f6308..ab9fb1ec332 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_filter.js @@ -18,7 +18,7 @@ export class GitLabDropdownFilter { this.filterInputBlur = (ref = this.options.filterInputBlur) != null ? ref : true; const $inputContainer = this.input.parent(); const $clearButton = $inputContainer.find('.js-dropdown-input-clear'); - $clearButton.on('click', e => { + $clearButton.on('click', (e) => { // Clear click e.preventDefault(); e.stopPropagation(); @@ -27,7 +27,7 @@ export class GitLabDropdownFilter { // Key events timeout = ''; this.input - .on('keydown', e => { + .on('keydown', (e) => { const keyCode = e.which; if (keyCode === 13 && !options.elIsInput) { e.preventDefault(); @@ -46,7 +46,7 @@ export class GitLabDropdownFilter { return (timeout = setTimeout(() => { $inputContainer.parent().addClass('is-loading'); - return this.options.query(this.input.val(), data => { + return this.options.query(this.input.val(), (data) => { $inputContainer.parent().removeClass('is-loading'); return this.options.callback(data); }); @@ -94,13 +94,13 @@ export class GitLabDropdownFilter { // } else if (isObject(data)) { results = {}; - Object.keys(data).forEach(key => { + Object.keys(data).forEach((key) => { group = data[key]; tmp = fuzzaldrinPlus.filter(group, searchText, { key: this.options.keys, }); if (tmp.length) { - results[key] = tmp.map(item => item); + results[key] = tmp.map((item) => item); } }); } diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js index 29185bb5a4d..61d3e5fbf38 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_input.js @@ -5,7 +5,7 @@ export class GitLabDropdownInput { this.fieldName = this.options.fieldName || 'field-name'; const $inputContainer = this.input.parent(); const $clearButton = $inputContainer.find('.js-dropdown-input-clear'); - $clearButton.on('click', e => { + $clearButton.on('click', (e) => { // Clear click e.preventDefault(); e.stopPropagation(); @@ -13,13 +13,13 @@ export class GitLabDropdownInput { }); this.input - .on('keydown', e => { + .on('keydown', (e) => { const keyCode = e.which; if (keyCode === 13 && !options.elIsInput) { e.preventDefault(); } }) - .on('input', e => { + .on('input', (e) => { let val = e.currentTarget.value || this.options.inputFieldName; val = val .split(' ') diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js index 1f6a2e1f646..ae5d3298b62 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown_remote.js @@ -15,7 +15,7 @@ export class GitLabDropdownRemote { if (this.options.beforeSend) { this.options.beforeSend(); } - return this.dataEndpoint('', data => { + return this.dataEndpoint('', (data) => { // Fetch the data by calling the data function if (this.options.success) { this.options.success(data); |