diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-20 14:18:08 +0300 |
commit | 5afcbe03ead9ada87621888a31a62652b10a7e4f (patch) | |
tree | 9918b67a0d0f0bafa6542e839a8be37adf73102d /app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js | |
parent | c97c0201564848c1f53226fe19d71fdcc472f7d0 (diff) |
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js')
-rw-r--r-- | app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js index 69f1d62539a..3f14a8a8a26 100644 --- a/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js +++ b/app/assets/javascripts/deprecated_jquery_dropdown/gl_dropdown.js @@ -94,6 +94,7 @@ export class GitLabDropdown { dataType: this.options.dataType, beforeSend: this.toggleLoading.bind(this), success: (data) => { + this.dropdown.trigger('done.remote.loading.gl.dropdown'); this.fullData = data; this.parseData(this.fullData); this.focusTextInput(); @@ -220,7 +221,12 @@ export class GitLabDropdown { } toggleLoading() { - return $('.dropdown-menu', this.dropdown).toggleClass(LOADING_CLASS); + const menu = this.dropdown[0].querySelector('.dropdown-menu'); + const isLoading = menu.classList.contains(LOADING_CLASS); + + this.dropdown.trigger(`toggle.${isLoading ? 'off' : 'on'}.loading.gl.dropdown`); + + menu.classList.toggle(LOADING_CLASS); } togglePage() { @@ -719,4 +725,8 @@ export class GitLabDropdown { clearField(field, isInput) { return isInput ? field.val('') : field.remove(); } + + close() { + this.dropdown.find('.dropdown-menu-toggle').dropdown('hide'); + } } |