From 9ac68f9bfa9de27b0678cafe7e75c280e02175d5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Aug 2012 14:11:52 +0300 Subject: [PATCH] minor changes --- lib/client/menu.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/client/menu.js b/lib/client/menu.js index 51a48e28..68d98095 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -91,9 +91,11 @@ 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; /* hide invisible menu layer */ - lLayer.style.cssText = lLayer.style.cssText - .replace('z-index: 1', 'z-index:-1') + if(lStyle) + lLayer.style.cssText = lStyle + .replace('z-index: 1', 'z-index:-1') /* get element by point */ var lElement = document.elementFromPoint(pEvent.x, pEvent.y) @@ -105,8 +107,8 @@ CloudCommander.Menu.set = (function(){ .parentElement); /* show invisible menu layer */ - lLayer.style.cssText = lLayer.style.cssText - .replace('z-index: -1', 'z-index: 1') + if(lStyle) + lLayer.style.cssText = lStyle; /* if document.onclick was set up * before us, it's best time to call it