mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
Revert "feature(view) show(pData) -> show(pData, pCallBack)"
This reverts commit f461d99fc4.
This commit is contained in:
parent
5cc9f90893
commit
bb3265575d
1 changed files with 11 additions and 21 deletions
|
|
@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue