From 67699f95060a12d01b07cc976e0cb3db883e68b7 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 21 Feb 2018 09:48:07 +0100 Subject: Clean scss, use proper loading icon and menu position on narrow screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/js.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index fa92508ff7a..89f6f465ead 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -681,6 +681,7 @@ var OCP = {}, * @returns {undefined} */ registerMenu: function($toggle, $menuEl, toggle) { + console.trace(); var self = this; $menuEl.addClass('menu'); $toggle.on('click.menu', function(event) { @@ -696,6 +697,9 @@ var OCP = {}, // close it self.hideMenus(); } + + $(event.currentTarget).addClass('openedMenu'); + $menuEl.slideToggle(OC.menuSpeed, toggle); OC._currentMenu = $menuEl; OC._currentMenuToggle = $toggle; @@ -730,6 +734,7 @@ var OCP = {}, } }); } + $('.openedMenu').removeClass('openedMenu'); OC._currentMenu = null; OC._currentMenuToggle = null; }, @@ -1480,7 +1485,7 @@ function initCore() { if(event.which === 1 && !event.ctrlKey && !event.metaKey) { $page.find('img').remove(); $page.find('div').remove(); // prevent odd double-clicks - $page.prepend($('
').addClass('icon-loading-small-dark')); + $page.prepend($('
').addClass('icon-loading-small')); } else { // Close navigation when opening menu entry in // a new tab @@ -1702,7 +1707,7 @@ OC.PasswordConfirmation = { requiresPasswordConfirmation: function() { var serverTimeDiff = this.pageLoadTime - (nc_pageLoad * 1000); var timeSinceLogin = moment.now() - (serverTimeDiff + (nc_lastLogin * 1000)); - + // if timeSinceLogin > 30 minutes and user backend allows password confirmation return (backendAllowsPasswordConfirmation && timeSinceLogin > 30 * 60 * 1000); }, -- cgit v1.2.3 From 15a3caedc09c33b8c3037153a4316076715ffb76 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Wed, 21 Feb 2018 15:12:42 +0100 Subject: 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(-) (limited to 'core/js') diff --git a/core/css/header.scss b/core/css/header.scss index ff34f1db357..a2c91d00ee4 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 9e7ec552830..b0f302e1599 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 89f6f465ead..3cdaab0cde9 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 c8c8ec84efa..e11620a3111 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -80,7 +80,7 @@ - + -- cgit v1.2.3 From 72861f2dfbe68c43b05eb00b696ed9129d513b7f Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Thu, 22 Feb 2018 09:59:48 +0100 Subject: Use correct variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/js.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/js') diff --git a/core/js/js.js b/core/js/js.js index 3cdaab0cde9..3c6ababf764 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -699,7 +699,7 @@ var OCP = {}, } if (headerMenu === true) { - $(event.currentTarget).parent().addClass('openedMenu'); + $menuEl.parent().addClass('openedMenu'); } $menuEl.slideToggle(OC.menuSpeed, toggle); -- cgit v1.2.3