mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactored
This commit is contained in:
parent
d3c8122ad0
commit
7f33f3a0e3
1 changed files with 3 additions and 10 deletions
|
|
@ -211,8 +211,6 @@ var CloudCommander, Util, DOM, $;
|
|||
function set(){
|
||||
if(!MenuSeted){
|
||||
$.contextMenu(getConfig());
|
||||
|
||||
var lFunc_f = document.onclick;
|
||||
/*
|
||||
* Menu works in some crazy way so need a
|
||||
* little hack to get every thing work out.
|
||||
|
|
@ -225,7 +223,7 @@ var CloudCommander, Util, DOM, $;
|
|||
* is not going on. All magic happening in
|
||||
* DOM tree
|
||||
*/
|
||||
document.onclick = function(pEvent){
|
||||
DOM.addClickListener(function(pEvent){
|
||||
/* if clicked on menu item */
|
||||
var lClassName = pEvent.target.parentElement.className;
|
||||
switch(lClassName){
|
||||
|
|
@ -235,7 +233,7 @@ var CloudCommander, Util, DOM, $;
|
|||
return;
|
||||
}
|
||||
|
||||
if(pEvent && pEvent.x && pEvent.y){
|
||||
if(pEvent && pEvent.x){
|
||||
var lLayer = DOM.getById('context-menu-layer');
|
||||
if(lLayer){
|
||||
var lStyle;
|
||||
|
|
@ -266,15 +264,10 @@ var CloudCommander, Util, DOM, $;
|
|||
if(lLayer && lStyle)
|
||||
lLayer.style.cssText = lStyle;
|
||||
|
||||
/* if document.onclick was set up
|
||||
* before us, it's best time to call it
|
||||
*/
|
||||
Util.exec(lFunc_f);
|
||||
|
||||
KeyBinding.set();
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
MenuSeted = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue