Create special option to toggle header menu container

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-02-21 15:12:42 +01:00
parent 67699f9506
commit 15a3caedc0
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
4 changed files with 9 additions and 7 deletions

View File

@ -461,7 +461,7 @@ nav {
opacity: .6;
}
}
.app-loading .icon-loading-small {
.app-loading .icon-loading-small-dark {
top: 12px;
width: 20px;
height: 20px;

View File

@ -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));

View File

@ -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) {

View File

@ -80,7 +80,7 @@
<defs><filter id="invertMenuMore-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invertMenuMore-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>" class="app-icon"></image>
</svg>
<div class="icon-loading-small-dark" style="display:none;"></div>
<div class="icon-loading-small" style="display:none;"></div>
<span><?php p($entry['name']); ?></span>
</a>
</li>