add OC.menuSpeed to control the animation speed of menu toggle

This commit is contained in:
Morris Jobke 2014-05-19 15:44:19 +02:00 committed by Jan-Christoph Borchardt
parent 72ba396905
commit de23ae735b
1 changed files with 8 additions and 7 deletions

View File

@ -183,7 +183,8 @@ var OC={
appConfig: window.oc_appconfig || {},
theme: window.oc_defaults || {},
coreApps:['', 'admin','log','search','settings','core','3rdparty'],
menuSpeed: 100,
/**
* Get an absolute url to a file in an app
* @param {string} app the id of the app the file belongs to
@ -531,7 +532,7 @@ var OC={
$toggle.addClass('menutoggle');
$toggle.on('click.menu', function(event) {
if ($menuEl.is(OC._currentMenu)) {
$menuEl.slideUp(200);
$menuEl.slideUp(OC.menuSpeed);
OC._currentMenu = null;
OC._currentMenuToggle = null;
return false;
@ -541,7 +542,7 @@ var OC={
// close it
OC._currentMenu.hide();
}
$menuEl.slideToggle(200);
$menuEl.slideToggle(OC.menuSpeed);
OC._currentMenu = $menuEl;
OC._currentMenuToggle = $toggle;
return false;
@ -554,7 +555,7 @@ var OC={
unregisterMenu: function($toggle, $menuEl) {
// close menu if opened
if ($menuEl.is(OC._currentMenu)) {
$menuEl.slideUp(200);
$menuEl.slideUp(OC.menuSpeed);
OC._currentMenu = null;
OC._currentMenuToggle = null;
}
@ -1068,7 +1069,7 @@ function initCore() {
}
});
$('#settings #expand').click(function(event) {
$('#settings #expanddiv').slideToggle(200);
$('#settings #expanddiv').slideToggle(OC.menuSpeed);
event.stopPropagation();
});
$('#settings #expanddiv').click(function(event){
@ -1076,7 +1077,7 @@ function initCore() {
});
//hide the user menu when clicking outside it
$(document).click(function(){
$('#settings #expanddiv').slideUp(200);
$('#settings #expanddiv').slideUp(OC.menuSpeed);
});
// all the tipsy stuff needs to be here (in reverse order) to work
@ -1097,7 +1098,7 @@ function initCore() {
return false;
}
if (OC._currentMenu) {
OC._currentMenu.slideUp(200);
OC._currentMenu.slideUp(OC.menuSpeed);
}
OC._currentMenu = null;
OC._currentMenuToggle = null;