mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
now fancybox loads when f3 key pressed
This commit is contained in:
parent
27ac265a40
commit
0dec9cc2ac
2 changed files with 27 additions and 26 deletions
|
|
@ -23,6 +23,8 @@ CloudCommander.keyBinding=(function(){
|
|||
else if(event.keyCode===114){
|
||||
if (typeof CloudCommander.Viewer === 'function'){
|
||||
CloudCommander.Viewer();
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
/* навигация по таблице файлов*/
|
||||
|
|
|
|||
|
|
@ -92,17 +92,18 @@ CloudCommander.Viewer.FancyBox = {
|
|||
|
||||
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);
|
||||
|
||||
var lCurrent = this.getByClass('current-file');
|
||||
lCurrent.length &&
|
||||
(lCurrent = lCurrent[0]);
|
||||
|
||||
var lA = lCurrent.getElementsByClassName('fancybox');
|
||||
|
||||
var lConfig = this.getConfig();
|
||||
|
||||
lA.length &&
|
||||
$.fancybox.open({ href : lA[0].href },
|
||||
lConfig);
|
||||
}),
|
||||
|
||||
getById : function(pId){return document.getElementById(pId);},
|
||||
|
|
@ -114,31 +115,29 @@ CloudCommander.Viewer.FancyBox = {
|
|||
CloudCommander.Viewer.Keys = (function(){
|
||||
"use strict";
|
||||
|
||||
var lCallBack_f = (function(pParent){
|
||||
var key_event = function(){
|
||||
return function(event){
|
||||
/* если клавиши можно обрабатывать */
|
||||
if(CloudCommander.keyBinded){
|
||||
/* if f3 pressed */
|
||||
if(event.keyCode===114){
|
||||
CloudCommander.Viewer.FancyBox.show();
|
||||
|
||||
event.preventDefault(pParent);
|
||||
}
|
||||
var lCallBack_f = (function(){
|
||||
var key_event = function(event){
|
||||
/* если клавиши можно обрабатывать */
|
||||
if(CloudCommander.keyBinded){
|
||||
/* if f3 pressed */
|
||||
if(event.keyCode===114){
|
||||
CloudCommander.Viewer.FancyBox.show();
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/* добавляем обработчик клавишь */
|
||||
if (document.addEventListener)
|
||||
document.addEventListener('keydown', key_event(pParent),false);
|
||||
document.addEventListener('keydown', key_event(),false);
|
||||
|
||||
else
|
||||
document.onkeypress=key_event;
|
||||
|
||||
/* showing image previewer */
|
||||
/* showing images preview*/
|
||||
CloudCommander.Viewer.FancyBox.show();
|
||||
});
|
||||
|
||||
CloudCommander.Viewer.FancyBox.load(this.FancyBox, lCallBack_f(this));
|
||||
CloudCommander.Viewer.FancyBox.load(this.FancyBox, lCallBack_f());
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue