Commit 11c79cb5 authored by Raihan Kabir's avatar Raihan Kabir Committed by Phil Hughes

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

parent d3042ab9
/* 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 'underscore';
......@@ -34,8 +34,6 @@ Sidebar.prototype.addEventListeners = function() {
this.sidebar.on('click', '.sidebar-collapsed-icon', this, this.sidebarCollapseClicked);
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);
return $(document)
......@@ -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) {
if ($(e.currentTarget).hasClass('dont-change-state')) {
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