Commit 7044df7d authored by Phil Hughes's avatar Phil Hughes

Merge branch 'rk4bir-master-patch-81204' into 'master'

Resolve "Migrate '.fa-spinner' to '.spinner' for 'app/assets/javascripts/right_sidebar.js'"

Closes #202284

See merge request gitlab-org/gitlab!25017
parents 253a09fc 11c79cb5
/* eslint-disable func-names, consistent-return, no-else-return, no-param-reassign */ /* eslint-disable func-names, consistent-return, no-param-reassign */
import $ from 'jquery'; import $ from 'jquery';
import _ from 'underscore'; import _ from 'underscore';
...@@ -34,8 +34,6 @@ Sidebar.prototype.addEventListeners = function() { ...@@ -34,8 +34,6 @@ Sidebar.prototype.addEventListeners = function() {
this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked); this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked);
this.sidebar.on('hidden.gl.dropdown', this, this.onSidebarDropdownHidden); this.sidebar.on('hidden.gl.dropdown', this, this.onSidebarDropdownHidden);
$('.dropdown').on('loading.gl.dropdown', this.sidebarDropdownLoading);
$('.dropdown').on('loaded.gl.dropdown', this.sidebarDropdownLoaded);
$document.on('click', '.js-sidebar-toggle', this.sidebarToggleClicked); $document.on('click', '.js-sidebar-toggle', this.sidebarToggleClicked);
return $(document) return $(document)
...@@ -133,36 +131,6 @@ Sidebar.prototype.todoUpdateDone = function(data) { ...@@ -133,36 +131,6 @@ Sidebar.prototype.todoUpdateDone = function(data) {
}); });
}; };
Sidebar.prototype.sidebarDropdownLoading = function() {
const $sidebarCollapsedIcon = $(this)
.closest('.block')
.find('.sidebar-collapsed-icon');
const img = $sidebarCollapsedIcon.find('img');
const i = $sidebarCollapsedIcon.find('i');
const $loading = $('<i class="fa fa-spinner fa-spin"></i>');
if (img.length) {
img.before($loading);
return img.hide();
} else if (i.length) {
i.before($loading);
return i.hide();
}
};
Sidebar.prototype.sidebarDropdownLoaded = function() {
const $sidebarCollapsedIcon = $(this)
.closest('.block')
.find('.sidebar-collapsed-icon');
const img = $sidebarCollapsedIcon.find('img');
$sidebarCollapsedIcon.find('i.fa-spin').remove();
const i = $sidebarCollapsedIcon.find('i');
if (img.length) {
return img.show();
} else {
return i.show();
}
};
Sidebar.prototype.sidebarCollapseClicked = function(e) { Sidebar.prototype.sidebarCollapseClicked = function(e) {
if ($(e.currentTarget).hasClass('dont-change-state')) { if ($(e.currentTarget).hasClass('dont-change-state')) {
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment