diff --git a/lib/client/viewer.js b/lib/client/viewer.js index f8141cdf..58ab50ef 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -6,32 +6,27 @@ CloudCommander.Viewer = {getByClass : function(pClass){ return document.getElementsByClassName(pClass); }}; CloudCommander.Viewer.FancyBox = { - load: function(){ - - var lInit_f = (function(pParent){ - return function(){ - $(".fancybox").fancybox({ - openEffect : 'none', - closeEffect : 'none', - overlay : { - opacity: 0.1, - css : { - 'background-color' : '#fff' - } + init: (function(){ + $(".fancybox").fancybox({ + openEffect : 'none', + closeEffect : 'none', + helpers : { + overlay : { + opacity: 0.1, + css : { + 'background-color' : '#fff' } - }); - - pParent.set(); - }; - }); - + } + } + }); + }), + load: function(){ CloudCommander.cssLoad({ src : 'http://fancyapps.com/fancybox/source/jquery.fancybox.css' }); CloudCommander.jsload( - 'http://fancyapps.com/fancybox/source/jquery.fancybox.pack.js', - lInit_f(this)); + 'http://fancyapps.com/fancybox/source/jquery.fancybox.pack.js'); }, set: function(){ @@ -55,6 +50,8 @@ CloudCommander.Viewer.FancyBox = { (lA[i].className = 'fancybox') && (lA[i].rel = 'gallery'); } + + this.init(); }catch(pError){ console.log(pError); }