mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(view) show: change names
This commit is contained in:
parent
33e5205d1c
commit
944a71e216
1 changed files with 14 additions and 15 deletions
|
|
@ -60,33 +60,32 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
/**
|
||||
* function shows FancyBox
|
||||
*/
|
||||
function show(pData, pCallBack, pConfig) {
|
||||
var lPath, lElement, lAfterFunc, lFunc, name, isImage,
|
||||
function show(data, callback, newConfig) {
|
||||
var path, element, func, name, isImage,
|
||||
config = {};
|
||||
|
||||
if (!Loading) {
|
||||
Element = $('<div id=view tabindex=0>');
|
||||
if (pData) {
|
||||
lElement = $(Element).append(pData);
|
||||
lFunc = function() {
|
||||
Util.exec(pCallBack);
|
||||
};
|
||||
|
||||
if (data) {
|
||||
element = $(Element).append(data);
|
||||
func = Util.retExec(callback);
|
||||
|
||||
Config.afterShow = lFunc;
|
||||
Config.afterShow = func;
|
||||
|
||||
Util.copyObj(config, Config);
|
||||
|
||||
for (name in pConfig)
|
||||
config[name] = pConfig[name];
|
||||
for (name in newConfig)
|
||||
config[name] = newConfig[name];
|
||||
|
||||
$.fancybox(lElement, config);
|
||||
$.fancybox(element, config);
|
||||
|
||||
} else {
|
||||
lPath = CloudFunc.FS + Info.path;
|
||||
isImage = $.fancybox.isImage(lPath);
|
||||
path = CloudFunc.FS + Info.path;
|
||||
isImage = $.fancybox.isImage(path);
|
||||
|
||||
if (isImage) {
|
||||
$.fancybox.open({ href : lPath }, Config);
|
||||
$.fancybox.open({ href : path }, Config);
|
||||
} else
|
||||
Info.getData(function(data) {
|
||||
var element = document.createTextNode(data);
|
||||
|
|
@ -105,7 +104,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
|
||||
/**
|
||||
* function loads css and js of FancyBox
|
||||
* @pCallBack - executes, when everything loaded
|
||||
* @callback - executes, when everything loaded
|
||||
*/
|
||||
function load(callback) {
|
||||
var dir = CloudCmd.LIBDIRCLIENT + 'view/fancyBox/source/',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue