From 6377058ef0eb997d1ea49eea85b324e0fd9ab69a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 15 Aug 2012 15:40:32 -0400 Subject: [PATCH] minor changes --- lib/client/menu.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/client/menu.js b/lib/client/menu.js index 0263aed0..f5aa4d85 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -1,4 +1,4 @@ -var CloudCommander, CloudFunc, $; +var CloudCommander, $; /* object contains jQuery-contextMenu * https://github.com/medialize/jQuery-contextMenu */ @@ -23,7 +23,7 @@ CloudCommander.Menu.getConfig = (function(){ else{ var lViewer = CloudCommander.Viewer.get(); if(lViewer && lViewer.show) - lViewer.show() + lViewer.show(); } }}, edit: {name: "Edit", callback: function(key, opt){ @@ -32,7 +32,7 @@ CloudCommander.Menu.getConfig = (function(){ else{ var lEditor = CloudCommander.Editor.get(); if(lEditor && lEditor.show) - lEditor.show() + lEditor.show(); } }} @@ -86,8 +86,8 @@ CloudCommander.Menu.set = (function(){ * DOM tree */ document.onclick = function(pEvent){ - if(pEvent.x && pEvent.y){ - var lLayer = lThis.getById('context-menu-layer') + if(pEvent && pEvent.x && pEvent.y){ + var lLayer = lThis.getById('context-menu-layer'); var lStyle; if(lLayer) @@ -95,10 +95,10 @@ CloudCommander.Menu.set = (function(){ /* hide invisible menu layer */ if(lStyle) lLayer.style.cssText = lStyle - .replace('z-index: 1', 'z-index:-1') + .replace('z-index: 1', 'z-index:-1'); /* get element by point */ - var lElement = document.elementFromPoint(pEvent.x, pEvent.y) + var lElement = document.elementFromPoint(pEvent.x, pEvent.y); var lTag = lElement.tagName; var lParent; @@ -121,7 +121,7 @@ CloudCommander.Menu.set = (function(){ if(typeof lFunc_f === 'function') lFunc_f(); } - } + }; this.seted = true; } @@ -137,10 +137,10 @@ CloudCommander.Menu.show = (function(pParent, pPosition){ pParent.set(); if(pPosition && pPosition.x && pPosition.y) - $('li').contextMenu(pPosition) + $('li').contextMenu(pPosition); else $('li').contextMenu(); - } + }; }); /* key binding function */