minor changes

This commit is contained in:
coderaiser 2012-08-15 15:40:32 -04:00
parent b62fa33927
commit 6377058ef0

View file

@ -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 */