From 714647d3a5fa6f0eca45dbbf72c52ee46c854e74 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 27 Jan 2014 06:21:37 -0500 Subject: [PATCH] refactor(view) view, afterShow --- lib/client/view.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/client/view.js b/lib/client/view.js index 2206aac4..b70dea4a 100644 --- a/lib/client/view.js +++ b/lib/client/view.js @@ -12,7 +12,9 @@ var CloudCmd, Util, DOM, CloudFunc, $; Info = DOM.CurrentInfo, Key = CloudCmd.Key, Images = DOM.Images, - View = Util.exec, + View = function() { + Util.exec(arguments); + }, Element, Config = { @@ -20,9 +22,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; Images.hideLoad(); Key.unsetBind(); }, - afterShow : function() { - Element.focus(); - }, + afterShow : afterShow, beforeClose : Key.setBind, @@ -73,6 +73,10 @@ var CloudCmd, Util, DOM, CloudFunc, $; Events.addKey(listener); } + function afterShow() { + Element.focus(); + } + /** * function shows FancyBox */ @@ -84,9 +88,8 @@ var CloudCmd, Util, DOM, CloudFunc, $; Element = $('
'); if (pData) { lElement = $(Element).append(pData); - lAfterFunc = Config.afterShow, lFunc = function() { - Util.exec(lAfterFunc); + afterShow(); Util.exec(pCallBack); };