diff --git a/lib/client/config.js b/lib/client/config.js index fb12db54..7c76662b 100644 --- a/lib/client/config.js +++ b/lib/client/config.js @@ -4,10 +4,21 @@ var CloudCommander; (function(){ "use strict"; - CloudCommander.Config = {}; + var cloudcmd = CloudCommander; - CloudCommander.Config.Keys = function(){ + var Config = {}; + + Config.Show = (function(){ + console.log('config showed'); + }); + + Config.Keys = function(){ console.log('config.js loaded'); + cloudcmd.Viewer(function(){ + Config.Show(); + }); }; + + cloudcmd.Config = Config; })(); \ No newline at end of file diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 45f50628..78c655be 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -167,15 +167,21 @@ var CloudCommander, CloudFunc, $; CloudCommander.Viewer.FancyBox.show = (function(pCurrentFile){ CloudCommander.Viewer.FancyBox.set(); - - var lA = Util.getByClass('fancybox', pCurrentFile)[0]; + var lConfig = this.getConfig(); - if(lA){ - if(lA.rel) - $.fancybox.open({ href : lA.href }, - lConfig); - else this.loadData(lA); + if(typeof pCurrentFile !== 'function'){ + var lA = Util.getByClass('fancybox', pCurrentFile)[0]; + if(lA){ + if(lA.rel) + $.fancybox.open({ href : lA.href }, + lConfig); + else this.loadData(lA); + } + } + else { + var lFunc_f = pCurrentFile; + lFunc_f(); } Util.Images.hideLoad();