diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-16 13:03:41 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-16 13:03:41 -0600 |
commit | cd4ebe2777b268f916a5edbbbc49f65504a1e12b (patch) | |
tree | e3d5f10ec1e071bd1de2b4a85aa4ee3ae4503fb6 /core/js | |
parent | 2a9d1a7147b5494d2c8dda15a9ab4f74527b4a97 (diff) | |
parent | b8ef61645522322486a055df40d3d773964de720 (diff) | |
download | nextcloud-server-cd4ebe2777b268f916a5edbbbc49f65504a1e12b.tar.gz nextcloud-server-cd4ebe2777b268f916a5edbbbc49f65504a1e12b.zip |
Merge pull request #3008 from nextcloud/appmenu-experiment
Show apps in header
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/js.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js index 6fd66c9c9bb..c8907cdfc90 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1369,6 +1369,10 @@ function initCore() { * If the screen is bigger, the main menu is not a toggle any more. */ function setupMainMenu() { + + // init the more-apps menu + OC.registerMenu($('#more-apps'), $('#navigation')); + // toggle the navigation var $toggle = $('#header .header-appname-container'); var $navigation = $('#navigation'); @@ -1438,13 +1442,20 @@ function initCore() { // move triangle of apps dropdown to align with app name triangle // 2 is the additional offset between the triangles if($('#navigation').length) { - $('#header #nextcloud + .menutoggle').one('click', function(){ + $('#header #nextcloud + .menutoggle').on('click', function(){ + $('#menu-css-helper').remove(); 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>'); + $('head').append('<style id="menu-css-helper">#navigation:after { left: '+ caretPosition +'px; }</style>'); + } + }); + $('#header #appmenu .menutoggle').on('click', function() { + $('#appmenu').toggleClass('menu-open'); + if($('#appmenu').is(':visible')) { + $('#menu-css-helper').remove(); } }); } |