From bc877804a885e5cc765c0f5fd60ac86fb5751769 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 31 Jul 2013 12:42:58 +0000 Subject: [PATCH] fix(menu) View, Show -> retExec(show, "View, Show") --- lib/client/menu.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/client/menu.js b/lib/client/menu.js index c4c110aa..945cc392 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -168,8 +168,8 @@ var CloudCmd, Util, DOM, CloudFunc, $; function getConfig (){ var lRet, lMenuItems = { - 'View' : CloudCmd.View, - 'Edit' : CloudCmd.Edit, + 'View' : Util.retExec(show, 'View'), + 'Edit' : Util.retExec(show, 'Edit'), 'Rename' : function(){ setTimeout( Util.retExec(DOM.renameCurrent), 100); }, @@ -213,6 +213,14 @@ var CloudCmd, Util, DOM, CloudFunc, $; }; return lRet; + + function show(pName){ + var lEditor = CloudCmd[pName], + lResult = Util.exec(lEditor); + + if (!lResult) + Util.exec(lEditor.show); + } } /** function loads css and js of Menu