From e43da5293eec05c1848e8810533dcf58b0bc0735 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Aug 2012 14:14:18 +0300 Subject: [PATCH] Update lib/client/menu.js --- lib/client/menu.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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