diff --git a/lib/client/menu.js b/lib/client/menu.js index 28639102..51a48e28 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -76,6 +76,18 @@ CloudCommander.Menu.set = (function(){ var lThis = this; var lFunc_f = document.onclick; + /* + * Menu works in some crazy way so need a + * little hack to get every thing work out. + * When menu shows up, it drawing invisible + * layer wich hides all elements of + * Cloud Commander so it could not handle + * onclick events. To get every thing work + * how expected we hide out invisible layer + * so for observer it is nothing special + * is not going on. All magic happening in + * DOM tree + */ document.onclick = function(pEvent){ if(pEvent.x && pEvent.y){ var lLayer = lThis.getById('context-menu-layer') @@ -96,6 +108,9 @@ CloudCommander.Menu.set = (function(){ lLayer.style.cssText = lLayer.style.cssText .replace('z-index: -1', 'z-index: 1') + /* if document.onclick was set up + * before us, it's best time to call it + */ if(typeof lFunc_f === 'function') lFunc_f(); }