added position parameter

This commit is contained in:
coderaiser 2012-08-15 10:45:38 +03:00
parent 1b048852a1
commit 9aaf7f574c

View file

@ -43,18 +43,18 @@ CloudCommander.Menu.getConfig = (function(){
};
});
/* function loads css and js of FancyBox
/* function loads css and js of Menu
* @pParent - this
* @pCallBack - executes, when everything loaded
* @pPosition - position of menu
*/
CloudCommander.Menu.load = (function(pParent){
CloudCommander.Menu.load = (function(pParent, pPosition){
return function(){
var ljsLoad_f = function(){
var lUISrc = pParent.dir + 'jquery.ui.position.js';
var lMenuSrc = pParent.dir + 'jquery.contextMenu.js';
pParent.jsload(lUISrc, function(){
pParent.jsload(lMenuSrc, pParent.show(pParent));
pParent.jsload(lMenuSrc, pParent.show(pParent, pPosition));
});
};
@ -77,11 +77,11 @@ CloudCommander.Menu.set = (function(){
});
CloudCommander.Menu.seted = false;
CloudCommander.Menu.show = (function(pParent){
CloudCommander.Menu.show = (function(pParent, pPosition){
return function(){
pParent.set();
$('li').contextMenu(pParent.x, pParent.y);
$('li').contextMenu(pPosition.x, pPosition.y);
}
});
@ -136,5 +136,5 @@ CloudCommander.Menu.Keys = (function(){
CloudCommander.Menu.show();
};
CloudCommander.Menu.load(this);
CloudCommander.Menu.load(this, pPosition);
});