diff --git a/lib/client/viewer.js b/lib/client/viewer.js index 205c7e17..9412a296 100644 --- a/lib/client/viewer.js +++ b/lib/client/viewer.js @@ -20,22 +20,34 @@ CloudCommander.Viewer.FancyBox.dir = CloudCommander.Viewer.dir + * different objects) */ CloudCommander.Viewer.FancyBox.getConfig = (function(){ + var lThis = this; return{ - beforeShow : (function(){ - CloudCommander.keyBinded = false; - }), - beforeClose: (function(){ + /* function do her work + * before FauncyBox shows + */ + beforeShow : function(){ + CloudCommander.keyBinded = false; + }, + + afterShow : function(){ + var lEditor = lThis.getById('CloudViewer'); + if(lEditor) + lEditor.focus(); + }, + + beforeClose : function(){ CloudCommander.keyBinded = true; - }), - - openEffect : 'none', - closeEffect : 'none', + }, + openEffect : 'none', + closeEffect : 'none', + autoSize : false, + height : window.innerHeight, helpers : { overlay : { opacity: 0.1, css : { - 'background-color' : '#fff' + 'background-color' : '#fff' } } }, @@ -55,6 +67,18 @@ CloudCommander.Viewer.FancyBox.load = (function(pThis, pCallBack){ }); }; + pThis.cssSet({id:'viewer', + inner : '#CloudViewer{' + + 'font-size: 16px;' + + 'white-space :pre' + + '}' + + '#CloudViewer::selection{' + + 'background: #fe57a1;' + + 'color: #fff;' + + 'text-shadow: none;' + + '}' + }); + var lSrc = pThis.dir +'jquery.fancybox.pack.css'; pThis.cssLoad({ src : lSrc, @@ -83,7 +107,7 @@ CloudCommander.Viewer.FancyBox.loadData = (function(pA){ if(typeof data === 'object') data = JSON.stringify(data, null, 4); - $.fancybox('