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