diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2016-08-27 22:43:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-27 22:43:03 +0200 |
commit | ccbbf61ed60dcff59208c756b0d77b6157925ac7 (patch) | |
tree | be3cc324bbc1044df42e2945ff323c6fb9c4bfc8 /core/js | |
parent | 8bf9be21671b3a4f246ee43bc0806d55a818c8a4 (diff) | |
parent | 58f9340d93f8d107ba7c849b7536d546be8cf7ad (diff) | |
download | nextcloud-server-ccbbf61ed60dcff59208c756b0d77b6157925ac7.tar.gz nextcloud-server-ccbbf61ed60dcff59208c756b0d77b6157925ac7.zip |
Merge pull request #968 from Faldon/fixing_spinner_animation
Fixing infinite spinner animation
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/core/js/js.js b/core/js/js.js index 4e8d3a01416..799d2ba0b24 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1506,12 +1506,20 @@ function initCore() { if(!$app.is('a')) { $app = $app.closest('a'); } - if(!event.ctrlKey) { + if(event.which === 1 && !event.ctrlKey && !event.metaKey) { $app.addClass('app-loading'); } else { // Close navigation when opening app in // a new tab - OC.hideMenus(); + OC.hideMenus(function(){return false}); + } + }); + + $navigation.delegate('a', 'mouseup', function(event) { + if(event.which === 2) { + // Close navigation when opening app in + // a new tab via middle click + OC.hideMenus(function(){return false}); } }); } @@ -1519,14 +1527,29 @@ 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.which === 1 && !event.ctrlKey && !event.metaKey) { + $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(function(){return false}); + } + }); + + $menu.delegate('a', 'mouseup', function(event) { + if(event.which === 2) { + // Close navigation when opening app in + // a new tab via middle click + OC.hideMenus(function(){return false}); + } }); } |