aboutsummaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-16 13:03:41 -0600
committerGitHub <noreply@github.com>2017-03-16 13:03:41 -0600
commitcd4ebe2777b268f916a5edbbbc49f65504a1e12b (patch)
treee3d5f10ec1e071bd1de2b4a85aa4ee3ae4503fb6 /core/js
parent2a9d1a7147b5494d2c8dda15a9ab4f74527b4a97 (diff)
parentb8ef61645522322486a055df40d3d773964de720 (diff)
downloadnextcloud-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.js15
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();
}
});
}