Update lib/client/menu.js

This commit is contained in:
coderaiser 2012-08-15 13:59:53 +03:00
parent 48e915ed52
commit 315107e002

View file

@ -78,6 +78,12 @@ CloudCommander.Menu.set = (function(){
var lFunc_f = document.onclick;
document.onclick = function(pEvent){
if(pEvent.x && pEvent.y){
var lLayer = lThis.getById('context-menu-layer')
/* hide invisible menu layer */
lLayer.style.cssText = lLayer.style.cssText
.replace('z-index: 1', 'z-index:-1')
/* get element by point */
var lElement = document.elementFromPoint(pEvent.x, pEvent.y)
if (lElement.tagName === 'A')
lThis.setCurrentFile(lElement
@ -86,6 +92,10 @@ CloudCommander.Menu.set = (function(){
lThis.setCurrentFile(lElement
.parentElement);
/* show invisible menu layer */
lLayer.style.cssText = lLayer.style.cssText
.replace('z-index: -1', 'z-index: 1')
if(typeof lFunc_f === 'function')
lFunc_f();
}