mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Moving to root below branch label
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
50
source/web/scripts/menu.js
Normal file
50
source/web/scripts/menu.js
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// Helper functions for common components
|
||||
// Kevin Roast 12-04-2005
|
||||
//
|
||||
|
||||
// Menu component functions
|
||||
var _lastMenu = null;
|
||||
|
||||
// toggle a dynamic menu dropping down
|
||||
function _toggleMenu(e, menuId)
|
||||
{
|
||||
// hide any open menu
|
||||
if (_lastMenu != null && _lastMenu != menuId)
|
||||
{
|
||||
document.getElementById(_lastMenu).style.display = 'none';
|
||||
_lastMenu = null;
|
||||
}
|
||||
|
||||
// toggle visibility of the specified element id
|
||||
if (document.getElementById(menuId).style.display == 'none')
|
||||
{
|
||||
document.getElementById(menuId).style.display = 'block';
|
||||
|
||||
_lastMenu = menuId;
|
||||
|
||||
// set global onclick handler to hide menu
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation)
|
||||
{
|
||||
e.stopPropagation();
|
||||
}
|
||||
document.onclick = _hideLastMenu;
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(menuId).style.display = 'none';
|
||||
document.onclick = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the last opened menu
|
||||
function _hideLastMenu()
|
||||
{
|
||||
if (_lastMenu != null)
|
||||
{
|
||||
document.getElementById(_lastMenu).style.display = 'none';
|
||||
_lastMenu = null;
|
||||
document.onclick = null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user