diff --git a/lib/client/menu.js b/lib/client/menu.js index c891e824..72ec76f4 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -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; }