diff --git a/lib/client/menu.js b/lib/client/menu.js index 68d98095..9c483986 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -91,7 +91,10 @@ CloudCommander.Menu.set = (function(){ document.onclick = function(pEvent){ if(pEvent.x && pEvent.y){ var lLayer = lThis.getById('context-menu-layer') - var lStyle = lLayer.style.cssText; + var lStyle; + + if(lLayer) + lStyle = lLayer.style.cssText; /* hide invisible menu layer */ if(lStyle) lLayer.style.cssText = lStyle @@ -107,7 +110,7 @@ CloudCommander.Menu.set = (function(){ .parentElement); /* show invisible menu layer */ - if(lStyle) + if(lLayer && lStyle) lLayer.style.cssText = lStyle; /* if document.onclick was set up