fixed bug with context menu hiding (on Esc)

This commit is contained in:
coderaiser 2012-10-25 09:35:24 -04:00
parent aea3d8d9ff
commit 5d99d5750c
3 changed files with 20 additions and 16 deletions

View file

@ -35,6 +35,8 @@ elements one-by-one.
* Added function loadModule thet make it easier to connect
new module.
* Fixed bug with context menu hiding (on Esc). Keys was unbinded.
2012.10.01, Version 0.1.7

View file

@ -1243,13 +1243,13 @@ CloudClient.init = function(){
this.OLD_BROWSER = true;
Util.jsload(CloudClient.LIBDIRCLIENT + 'ie.js',
function(){
Util.jqueryLoad( CloudClient.initModules );
Util.jqueryLoad( initModules );
});
}
else CloudClient.initModules();
else initModules();
};
CloudClient.initModules = function(){
function initModules(){
loadModule({
path : 'keyBinding.js',
@ -1266,14 +1266,14 @@ CloudClient.initModules = function(){
for(var i = 0, n = pModules.length; i < n ; i++)
loadModule(pModules[i]);
CloudClient.baseInit();
baseInit();
},
error: CloudClient.baseInit
error: baseInit
});
};
}
CloudClient.baseInit = function(){
function baseInit(){
if(applicationCache){
var lFunc = applicationCache.onupdateready;
applicationCache.onupdateready = function(){
@ -1341,7 +1341,7 @@ CloudClient.baseInit = function(){
'height:' + lHeight +'px;' +
'}'
});
};
}
/* функция меняет ссыки на ajax-овые */
CloudClient._changeLinks = function(pPanelID){

View file

@ -47,6 +47,7 @@ var CloudCommander, $;
KeyBinding.set();
},
// define the elements of the menu
items: {
view: {name: 'View', callback: function(key, opt){
@ -208,16 +209,17 @@ var CloudCommander, $;
var key_event = (function(pEvent){
/* если клавиши можно обрабатывать */
if( KeyBinding.get() )
if( KeyBinding.get() ){
/* if shift + F10 pressed */
if(pEvent.keyCode === cloudcmd.KEY.F10 &&
pEvent.shiftKey){
var lCurrent = Util.getCurrentFile();
if(lCurrent)
$(lCurrent).contextMenu();
pEvent.preventDefault();
if(pEvent.keyCode === cloudcmd.KEY.F10 && pEvent.shiftKey){
var lCurrent = Util.getCurrentFile();
if(lCurrent)
$(lCurrent).contextMenu();
pEvent.preventDefault();
}
}
else if (pEvent.keyCode === cloudcmd.KEY.ESC)
KeyBinding.set();
});
/* добавляем обработчик клавишь */