From 55d2fa0d372f608132fa30d6656eb5f44d02bd3a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 5 Nov 2013 09:11:02 +0000 Subject: [PATCH] feature(config) add autosize --- lib/client/config.js | 5 ++++- lib/client/view.js | 13 +++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/client/config.js b/lib/client/config.js index bd9fffd3..994ecd5d 100644 --- a/lib/client/config.js +++ b/lib/client/config.js @@ -69,7 +69,10 @@ var CloudCmd, Util, DOM; } Images.hideLoad(); - CloudCmd.View.show(div); + + CloudCmd.View.show(div, null, { + autoSize: true + }); }); }, diff --git a/lib/client/view.js b/lib/client/view.js index 08654bee..2f4a702d 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -71,9 +71,9 @@ var CloudCmd, Util, DOM, CloudFunc, $; /** * function shows FancyBox */ - this.show = function(pData, pCallBack) { - var lPath, lElement, - lAfterFunc, lFunc; + this.show = function(pData, pCallBack, pConfig) { + var lPath, lElement, lAfterFunc, lFunc, name, + config = {}; if (!Loading) { Element = $('
'); @@ -87,7 +87,12 @@ var CloudCmd, Util, DOM, CloudFunc, $; Config.afterShow = lFunc; - $.fancybox(lElement, Config); + Util.copyObj(Config, config); + + for (name in pConfig) + config[name] = pConfig[name]; + + $.fancybox(lElement, config); } else { lPath = CloudFunc.FS + DOM.getCurrentPath();