fixed bug with setting up current file on click when menu is open

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
This commit is contained in:
coderaiser 2012-08-15 14:07:38 +03:00
parent 315107e002
commit 017e48470b

View file

@ -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();
}