From 5714189b0a9cf738993c8f53eb4e52c728cb65c3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 14 Aug 2012 16:19:39 +0300 Subject: [PATCH] added editor and viewer commands --- lib/client/menu.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/client/menu.js b/lib/client/menu.js index a9aecb72..0b4e6e19 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -19,8 +19,17 @@ CloudCommander.Menu.getConfig = (function(){ selector: 'li', // define the elements of the menu items: { - foo: {name: "View", callback: function(key, opt){ CloudCommander.Viewer();}}, - bar: {name: "Edit", callback: function(key, opt){ CloudCommander.Editor();}} + foo: {name: "View", callback: function(key, opt){ + if(typeof CloudCommander.Viewer === 'function') + CloudCommander.Viewer(); + else CloudCommander.Viewer.show(); + }}, + bar: {name: "Edit", callback: function(key, opt){ + if(typeof CloudCommander.Editor === 'function') + CloudCommander.Editor(); + else CloudCommander.Editor.show(); + + }} } // there's more, have a look at the demos and docs... };