Revert "feature(view) show(pData) -> show(pData, pCallBack)"

This reverts commit f461d99fc4.
This commit is contained in:
coderaiser 2013-06-23 03:35:42 -04:00
parent 5cc9f90893
commit bb3265575d

View file

@ -9,7 +9,6 @@ var CloudCmd, Util, DOM, CloudFunc, $;
var Key = CloudCmd.Key,
Images = DOM.Images,
View = this,
Element,
Config = {
beforeShow : function(){
@ -17,7 +16,9 @@ var CloudCmd, Util, DOM, CloudFunc, $;
Key.unsetBind();
},
afterShow : function(){
Element.focus();
var lEditor = DOM.getById('View');
if(lEditor)
lEditor.focus();
},
beforeClose : Key.setBind,
@ -52,31 +53,20 @@ var CloudCmd, Util, DOM, CloudFunc, $;
/**
* function shows FancyBox
*/
this.show = function(pData, pCallBack){
var lPath, lElement,
lAfterFunc, lFunc;
this.show = function(pData){
var lPath;
Element = $('<div id=view tabindex=0>');
if(pData) {
lElement = $(Element).append(pData);
lAfterFunc = Config.afterShow,
lFunc = function(){
Util.exec(lAfterFunc);
Util.exec(pCallBack);
};
Config.afterShow = lFunc;
$.fancybox(lElement, Config);
} else {
lPath = CloudFunc.FS + DOM.getCurrentPath();
if(pData)
$.fancybox(pData, Config);
else {
lPath = CloudFunc.FS + DOM.getCurrentPath();
if( Util.checkExtension(lPath, ['png','jpg', 'gif','ico']) ) {
$.fancybox.open({ href : lPath }, Config);
}
else
DOM.getCurrentData(function(pParams){
$.fancybox( Element.append(pParams.data), Config );
$.fancybox('<div id=view tabindex=0>' +
pParams.data + '</div>', Config);
});
}
};