refactor(menu) getConfig, show

This commit is contained in:
coderaiser 2014-04-02 07:41:22 -04:00
parent e6174b3595
commit 6db2bdbab6

View file

@ -181,8 +181,8 @@ var CloudCmd, Util, DOM, CloudFunc, $;
function getConfig () {
var lRet,
lMenuItems = {
'View' : show.bind(null, 'View'),
'Edit' : show.bind(null, 'Edit'),
'View' : Util.bind(show, 'View'),
'Edit' : Util.bind(show, 'Edit'),
'Rename' : function() {
setTimeout(DOM.renameCurrent, 100);
},
@ -234,12 +234,12 @@ var CloudCmd, Util, DOM, CloudFunc, $;
return lRet;
function show(pName) {
var lEditor = CloudCmd[pName],
lResult = Util.exec(lEditor);
function show(name) {
var module = CloudCmd[name],
ret = Util.exec(module);
if (!lResult)
Util.exec(lEditor.show);
if (!ret)
Util.exec(module.show);
}
}