Merge pull request #15512 from owncloud/autoclose-settings-menu

Don't stop event execution for menu item click
This commit is contained in:
Vincent Petry 2015-04-09 19:53:43 +02:00
commit 10ffa3b770

View file

@ -476,11 +476,14 @@ var OC={
registerMenu: function($toggle, $menuEl) {
$menuEl.addClass('menu');
$toggle.on('click.menu', function(event) {
// prevent the link event (append anchor to URL)
event.preventDefault();
if ($menuEl.is(OC._currentMenu)) {
$menuEl.slideUp(OC.menuSpeed);
OC._currentMenu = null;
OC._currentMenuToggle = null;
return false;
return;
}
// another menu was open?
else if (OC._currentMenu) {
@ -490,7 +493,6 @@ var OC={
$menuEl.slideToggle(OC.menuSpeed);
OC._currentMenu = $menuEl;
OC._currentMenuToggle = $toggle;
return false;
});
},