diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 043f0eb8..0c66f162 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -6,27 +6,34 @@ CloudCommander.Viewer = {getByClass : function(pClass){ return document.getElementsByClassName(pClass); }}; CloudCommander.Viewer.FancyBox = { - config: { - beforeShow : (function(){ + /* function return configureation + * for FancyBox open and + * onclick (it shoud be + * different objects) + */ + getConfig: (function(){ + return{ + beforeShow : (function(){ CloudCommander.keyBinded = false; - }), - beforeClose: (function(){ - CloudCommander.keyBinded = true; - }), - - openEffect : 'none', - closeEffect : 'none', - - helpers : { - overlay : { - opacity: 0.1, - css : { - 'background-color' : '#fff' + }), + beforeClose: (function(){ + CloudCommander.keyBinded = true; + }), + + openEffect : 'none', + closeEffect : 'none', + + helpers : { + overlay : { + opacity: 0.1, + css : { + 'background-color' : '#fff' + } } - } - }, - padding : 0 - }, + }, + padding : 0 + }; + }), load: function(){ var ljsLoad_f = function(){ CloudCommander.jsload( @@ -61,7 +68,7 @@ CloudCommander.Viewer.FancyBox = { (lA[i].rel = 'gallery'); } - $('.fancybox').fancybox(this.config); + $('.fancybox').fancybox(this.getConfig()); }catch(pError){ console.log(pError); } @@ -89,7 +96,7 @@ CloudCommander.Viewer.Keys = (function(){ var lA = lCurrent.getElementsByClassName('fancybox'); - var lConfig = pParent.FancyBox.config; + var lConfig = pParent.FancyBox.getConfig(); lA.length && $.fancybox.open({ href : lA[0].href },