mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 01:47:35 +00:00
now fancybox loads when f3 key pressed
This commit is contained in:
parent
325163a41f
commit
27ac265a40
3 changed files with 29 additions and 16 deletions
|
|
@ -822,8 +822,7 @@ try{
|
|||
CloudCommander.init();
|
||||
/* привязываем клавиши к функциям */
|
||||
CloudCommander.keyBinding();
|
||||
CloudCommander.Editor();
|
||||
CloudCommander.Viewer();
|
||||
CloudCommander.Editor();
|
||||
};
|
||||
}
|
||||
catch(err){}
|
||||
|
|
@ -19,6 +19,12 @@ CloudCommander.keyBinding=(function(){
|
|||
lCurrentFile=document.getElementsByClassName(CloudCommander.CURRENT_FILE)[0];
|
||||
}catch(error){console.log(error);}
|
||||
}
|
||||
/* if f3 pressed */
|
||||
else if(event.keyCode===114){
|
||||
if (typeof CloudCommander.Viewer === 'function'){
|
||||
CloudCommander.Viewer();
|
||||
}
|
||||
}
|
||||
/* навигация по таблице файлов*/
|
||||
/* если нажали клавишу вверх*/
|
||||
else if(event.keyCode===38){
|
||||
|
|
|
|||
|
|
@ -89,6 +89,22 @@ CloudCommander.Viewer.FancyBox = {
|
|||
console.log(pError);
|
||||
}
|
||||
},
|
||||
|
||||
show : (function(pParent){
|
||||
CloudCommander.Viewer.FancyBox.set();
|
||||
var lCurrent = pParent.getByClass('current-file');
|
||||
lCurrent.length &&
|
||||
(lCurrent = lCurrent[0]);
|
||||
|
||||
var lA = lCurrent.getElementsByClassName('fancybox');
|
||||
|
||||
var lConfig = pParent.FancyBox.getConfig();
|
||||
|
||||
lA.length &&
|
||||
$.fancybox.open({ href : lA[0].href },
|
||||
lConfig);
|
||||
}),
|
||||
|
||||
getById : function(pId){return document.getElementById(pId);},
|
||||
|
||||
getByClass : function(pClass){
|
||||
|
|
@ -104,21 +120,10 @@ CloudCommander.Viewer.Keys = (function(){
|
|||
/* если клавиши можно обрабатывать */
|
||||
if(CloudCommander.keyBinded){
|
||||
/* if f3 pressed */
|
||||
if(event.keyCode===114){
|
||||
CloudCommander.Viewer.FancyBox.set();
|
||||
var lCurrent = pParent.getByClass('current-file');
|
||||
lCurrent.length &&
|
||||
(lCurrent = lCurrent[0]);
|
||||
|
||||
var lA = lCurrent.getElementsByClassName('fancybox');
|
||||
|
||||
var lConfig = pParent.FancyBox.getConfig();
|
||||
|
||||
lA.length &&
|
||||
$.fancybox.open({ href : lA[0].href },
|
||||
lConfig);
|
||||
if(event.keyCode===114){
|
||||
CloudCommander.Viewer.FancyBox.show();
|
||||
|
||||
event.preventDefault();
|
||||
event.preventDefault(pParent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -130,6 +135,9 @@ CloudCommander.Viewer.Keys = (function(){
|
|||
|
||||
else
|
||||
document.onkeypress=key_event;
|
||||
|
||||
/* showing image previewer */
|
||||
CloudCommander.Viewer.FancyBox.show();
|
||||
});
|
||||
|
||||
CloudCommander.Viewer.FancyBox.load(this.FancyBox, lCallBack_f(this));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue