From 15a3caedc09c33b8c3037153a4316076715ffb76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 21 Feb 2018 15:12:42 +0100 Subject: [PATCH] Create special option to toggle header menu container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/css/header.scss | 2 +- core/js/contactsmenu.js | 2 +- core/js/js.js | 10 ++++++---- core/templates/layout.user.php | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/css/header.scss b/core/css/header.scss index ff34f1db35..a2c91d00ee 100644 --- a/core/css/header.scss +++ b/core/css/header.scss @@ -461,7 +461,7 @@ nav { opacity: .6; } } - .app-loading .icon-loading-small { + .app-loading .icon-loading-small-dark { top: 12px; width: 20px; height: 20px; diff --git a/core/js/contactsmenu.js b/core/js/contactsmenu.js index 9e7ec55283..b0f302e159 100644 --- a/core/js/contactsmenu.js +++ b/core/js/contactsmenu.js @@ -464,7 +464,7 @@ OC.registerMenu(this._$trigger, this.$el, function() { this._toggleVisibility(true); - }.bind(this)); + }.bind(this), true); this.$el.on('beforeHide', function() { this._toggleVisibility(false); }.bind(this)); diff --git a/core/js/js.js b/core/js/js.js index 89f6f465ea..3cdaab0cde 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -678,10 +678,10 @@ var OCP = {}, * @param {jQuery} $toggle * @param {jQuery} $menuEl * @param {function|undefined} toggle callback invoked everytime the menu is opened + * @param {boolean} headerMenu is this a top right header menu? * @returns {undefined} */ - registerMenu: function($toggle, $menuEl, toggle) { - console.trace(); + registerMenu: function($toggle, $menuEl, toggle, headerMenu) { var self = this; $menuEl.addClass('menu'); $toggle.on('click.menu', function(event) { @@ -698,7 +698,9 @@ var OCP = {}, self.hideMenus(); } - $(event.currentTarget).addClass('openedMenu'); + if (headerMenu === true) { + $(event.currentTarget).parent().addClass('openedMenu'); + } $menuEl.slideToggle(OC.menuSpeed, toggle); OC._currentMenu = $menuEl; @@ -1401,7 +1403,7 @@ function initCore() { initSessionHeartBeat(); } - OC.registerMenu($('#expand'), $('#expanddiv')); + OC.registerMenu($('#expand'), $('#expanddiv'), false, true); // toggle for menus $(document).on('mouseup.closemenus', function(event) { diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index c8c8ec84ef..e11620a311 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -80,7 +80,7 @@ - +