mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
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:
parent
315107e002
commit
017e48470b
1 changed files with 15 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue