summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-04-25 17:31:04 +0200
committerJulius Härtl <jus@bitgrid.net>2017-04-25 17:31:25 +0200
commit27b19aaba1c9a710bb2b1d3338a74ba05ea0678e (patch)
treee9a7a892b94fd08d1bfeb0d83e779d78638df303
parent673b58ef093c252a2cf6da1ebf4027b050e306de (diff)
downloadnextcloud-server-27b19aaba1c9a710bb2b1d3338a74ba05ea0678e.tar.gz
nextcloud-server-27b19aaba1c9a710bb2b1d3338a74ba05ea0678e.zip
Fix loading spinner for new app menu
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--core/css/header.scss31
-rw-r--r--core/js/js.js15
2 files changed, 33 insertions, 13 deletions
diff --git a/core/css/header.scss b/core/css/header.scss
index 3805dd493e7..619852faf60 100644
--- a/core/css/header.scss
+++ b/core/css/header.scss
@@ -294,19 +294,21 @@ nav {
max-height: 32px;
max-width: 32px;
}
- /* loading feedback for apps */
- .app-loading {
- .icon-loading-small-dark {
- display: inline !important;
- position: absolute;
- left: 12px;
- width: 16px;
- height: 16px;
- }
- .app-icon {
- -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
- opacity: 0;
- }
+
+}
+
+/* loading feedback for apps */
+.app-loading {
+ .icon-loading-small-dark {
+ display: inline !important;
+ position: absolute;
+ left: 12px;
+ width: 16px;
+ height: 16px;
+ }
+ .app-icon {
+ -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';
+ opacity: 0;
}
}
@@ -467,6 +469,9 @@ nav {
opacity: .6;
}
}
+ .app-loading .icon-loading-small-dark {
+ top:12px;
+ }
li:hover a,
diff --git a/core/js/js.js b/core/js/js.js
index 5fdafa6e412..95c00dd6448 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1398,6 +1398,7 @@ function initCore() {
// toggle the navigation
var $toggle = $('#header .header-appname-container');
var $navigation = $('#navigation');
+ var $appmenu = $('#appmenu');
// init the menu
OC.registerMenu($toggle, $navigation);
@@ -1427,6 +1428,20 @@ function initCore() {
OC.hideMenus(function(){return false});
}
});
+
+ $appmenu.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');
+ } else {
+ // Close navigation when opening app in
+ // a new tab
+ OC.hideMenus(function(){return false});
+ }
+ });
}
function setupUserMenu() {