add loading feedback to user menu entries (#23916)

fixes #19857
This commit is contained in:
Christoph Wurst 2016-04-14 11:53:09 +02:00 committed by Thomas Müller
parent 411fac892a
commit a2572ffec7
2 changed files with 21 additions and 0 deletions

View File

@ -294,6 +294,12 @@
color: #bbb;
cursor: pointer;
}
#settings .icon-loading-dark {
display: inline-block;
margin-bottom: -3px;
margin-right: 6px;
background-size: 16px 16px;
}
#expand {
display: block;
padding: 7px 30px 6px 10px;

View File

@ -1557,7 +1557,22 @@ function initCore() {
});
}
function setupUserMenu() {
var $menu = $('#header #settings');
$menu.delegate('a', 'click', function(event) {
var $page = $(event.target);
if (!$page.is('a')) {
$page = $page.closest('a');
}
$page.find('img').remove();
$page.find('div').remove(); // prevent odd double-clicks
$page.prepend($('<div/>').addClass('icon-loading-dark'));
});
}
setupMainMenu();
setupUserMenu();
// move triangle of apps dropdown to align with app name triangle
// 2 is the additional offset between the triangles