Skip to content

Commit

Permalink
Fixed user menu to not show spinner on ctrl+click.
Browse files Browse the repository at this point in the history
Fixes #616
  • Loading branch information
Thomas Pulzer authored and MorrisJobke committed Aug 9, 2016
1 parent c04b036 commit 1ab9477
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,14 +1519,21 @@ function initCore() {
function setupUserMenu() {
var $menu = $('#header #settings');

// show loading feedback
$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-small-dark'));
if(!event.ctrlKey) {
$page.find('img').remove();
$page.find('div').remove(); // prevent odd double-clicks
$page.prepend($('<div/>').addClass('icon-loading-small-dark'));
} else {
// Close navigation when opening menu entry in
// a new tab
OC.hideMenus();
}
});
}

Expand Down

0 comments on commit 1ab9477

Please sign in to comment.