diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-01-30 16:25:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-30 16:25:30 +0100 |
commit | 681437d23dc389dadb4c92358cc3f488e73f3f88 (patch) | |
tree | 9ffe2d6f7766ccef503ab1322375bcebe61277e3 /core/js/js.js | |
parent | 49ae3a3daa3ea479902386792b34359cbc8a8fdf (diff) | |
parent | 818c23d9f105b5352b8211ddb3cc04419b35270e (diff) | |
download | nextcloud-server-681437d23dc389dadb4c92358cc3f488e73f3f88.tar.gz nextcloud-server-681437d23dc389dadb4c92358cc3f488e73f3f88.zip |
Merge pull request #12785 from nextcloud/head-menu-half-height-fix
Unify headers menu design, fix click area
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/core/js/js.js b/core/js/js.js index c54b52c0f58..de27ff7a926 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1457,14 +1457,18 @@ function initCore() { $toggle.attr('href', '#'); $navigation.hide(); - // show loading feedback + // show loading feedback on more apps list $navigation.delegate('a', 'click', function(event) { var $app = $(event.target); if(!$app.is('a')) { $app = $app.closest('a'); } if(event.which === 1 && !event.ctrlKey && !event.metaKey) { - $app.addClass('app-loading'); + $app.find('svg').remove(); + $app.find('div').remove(); // prevent odd double-clicks + // no need for theming, loader is already inverted on dark mode + // but we need it over the primary colour + $app.prepend($('<div/>').addClass('icon-loading-small')); } else { // Close navigation when opening app in // a new tab @@ -1480,13 +1484,20 @@ function initCore() { } }); - $appmenu.delegate('a', 'click', function(event) { + // show loading feedback on visible apps list + $appmenu.delegate('li:not(#more-apps) > a', 'click', function(event) { var $app = $(event.target); if(!$app.is('a')) { $app = $app.closest('a'); } - if(event.which === 1 && !event.ctrlKey && !event.metaKey) { - $app.addClass('app-loading'); + if(event.which === 1 && !event.ctrlKey && !event.metaKey && $app.parent('#more-apps').length === 0) { + $app.find('svg').remove(); + $app.find('div').remove(); // prevent odd double-clicks + $app.prepend($('<div/>').addClass( + OCA.Theming && OCA.Theming.inverted + ? 'icon-loading-small' + : 'icon-loading-small-dark' + )); } else { // Close navigation when opening app in // a new tab |