refactor(view) show: change names

This commit is contained in:
coderaiser 2014-02-13 03:50:16 -05:00
parent 33e5205d1c
commit 944a71e216

View file

@ -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/',