diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 1e465910..9966ec96 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -6,20 +6,6 @@ CloudCommander.Viewer = {getByClass : function(pClass){ return document.getElementsByClassName(pClass); }}; CloudCommander.Viewer.FancyBox = { - init: (function(){ - $(".fancybox").fancybox({ - openEffect : 'none', - closeEffect : 'none', - helpers : { - overlay : { - opacity: 0.1, - css : { - 'background-color' : '#fff' - } - } - } - }); - }), load: function(){ var ljsLoad_f = function(){ CloudCommander.jsload( @@ -51,9 +37,7 @@ CloudCommander.Viewer.FancyBox = { CloudFunc.checkExtension(lName,['png','jpg']) && (lA[i].className = 'fancybox') && (lA[i].rel = 'gallery'); - } - - this.init(); + } }catch(pError){ console.log(pError); } @@ -82,8 +66,17 @@ CloudCommander.Viewer.Keys = (function(){ var lA = lCurrent.getElementsByClassName('fancybox'); lA.length && - $.fancybox.open({ href : lA[0].href }, - { padding : 0 } ); + $.fancybox.open({ href : lA[0].href },{ + helpers : { + overlay : { + opacity: 0.1, + css : { + 'background-color' : '#fff' + } + } + }, + padding : 0 + }); event.preventDefault(); }