diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2015-03-26 16:25:29 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2015-03-26 17:01:35 +0100 |
commit | e7dcc01017f90af72df952648b07b707b5a9ac75 (patch) | |
tree | 2bc22c5b00c3f31cbe80e5e12dcf917c04d5c50d /core | |
parent | 6b8f5abf98a5cc6eb65d3f92be5cde488df66e43 (diff) | |
download | nextcloud-server-e7dcc01017f90af72df952648b07b707b5a9ac75.tar.gz nextcloud-server-e7dcc01017f90af72df952648b07b707b5a9ac75.zip |
only move dropdown triangle when navigation is opened, fix timing bug
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/core/js/js.js b/core/js/js.js index a0a70e549e5..7a895a22419 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1139,13 +1139,6 @@ function initCore() { $('#settings #expanddiv').slideUp(OC.menuSpeed); }); - // move triangle of apps dropdown to align with app name triangle - // 68 is the additional offset coming from the logo width - if($('#navigation').length) { - var caretPosition = $('.header-appname + .icon-caret').offset().left - 2; - $('head').append('<style>#navigation:after { left: '+ caretPosition +'px; }</style>'); - } - // all the tipsy stuff needs to be here (in reverse order) to work $('.displayName .action').tipsy({gravity:'se', fade:true, live:true}); $('.password .action').tipsy({gravity:'se', fade:true, live:true}); @@ -1203,6 +1196,20 @@ function initCore() { setupMainMenu(); + // move triangle of apps dropdown to align with app name triangle + // 68 is the additional offset coming from the logo width + if($('#navigation').length) { + $('#header #owncloud + .menutoggle').one('click', function(){ + var caretPosition = $('.header-appname + .icon-caret').offset().left - 2; + if(caretPosition > 255) { + // if the app name is longer than the menu, just put the triangle in the middle + return; + } else { + $('head').append('<style>#navigation:after { left: '+ caretPosition +'px; }</style>'); + } + }); + } + // just add snapper for logged in users if($('#app-navigation').length && !$('html').hasClass('lte9')) { |