From 2b28a44facbf430677582f7f08abde33498f74de Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 2 Oct 2012 10:05:06 -0400 Subject: [PATCH] minor changes --- client.js | 26 ++++++++++++++++++++------ config.json | 2 +- lib/client/editor/_codemirror.js | 12 +++++++----- lib/client/terminal.js | 18 ++++++++++-------- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/client.js b/client.js index bef3f31b..794e5c94 100644 --- a/client.js +++ b/client.js @@ -142,15 +142,26 @@ CloudClient.Util = (function(){ var lXMLHTTP; this.addClass = function(pElement, pClass){ + var lRet_b = true; + var lClassList = pElement.classList; - if(lClassList) - lClassList.add(pClass); + if(lClassList){ + if( !lClassList.contains(pClass) ) + lClassList.add(pClass); + else + lRet_b = false; + } else{ var lSpaceChar = ''; if(pElement.className) lSpaceChar = ' '; - pElement.className += lSpaceChar + 'hidden'; + if( !pElement.contains(pClass) ) + pElement.className += lSpaceChar + pClass; + else + lRet_b = false; } + + return lRet_b; }; this.ajax = function(pParams){ @@ -584,7 +595,7 @@ CloudClient.Util = (function(){ }, hideLoad : function(){ - lLoadingImage = LImages_o.loading(); + lLoadingImage = LImages_o.loading(); Util.hide(lLoadingImage); }, @@ -791,14 +802,17 @@ CloudClient.Util = (function(){ }; this.hidePanel = function(pActive){ + var lRet_b = false; var lPanel = lThis.getPanel(pActive); if(lPanel) - this.hide(lPanel); + lRet_b = this.hide(lPanel); + + return lRet_b; }; this.hide = function(pElement){ - return this.addClass(pElement, 'hidden'); + return this.addClass(pElement, 'hidden'); }; this.removeClass = function(pElement, pClass){ diff --git a/config.json b/config.json index 898abb06..75bcf6c6 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "cache" : {"allowed" : false}, "appcache" : false, "minification" : { - "js" : true, + "js" : false, "css" : true, "html" : true, "img" : true diff --git a/lib/client/editor/_codemirror.js b/lib/client/editor/_codemirror.js index dc61b604..6e05c9eb 100644 --- a/lib/client/editor/_codemirror.js +++ b/lib/client/editor/_codemirror.js @@ -151,12 +151,14 @@ var CloudCommander, CloudFunc, CodeMirror; if(typeof data === 'object') data = JSON.stringify(data, null, 4); - initCodeMirror(data); + var lHided = Util.hidePanel(); + if(lHided){ + initCodeMirror(data); + + /* removing keyBinding if set */ + KeyBinding.unSet(); + } - /* removing keyBinding if set */ - KeyBinding.unSet(); - - Util.hidePanel(); Util.Images.hideLoad(); Loading = false; diff --git a/lib/client/terminal.js b/lib/client/terminal.js index 73e2d756..5303ebb1 100644 --- a/lib/client/terminal.js +++ b/lib/client/terminal.js @@ -66,14 +66,16 @@ var CloudCommander, $; JqueryTerminal.show = (function(){ Util.Images.hideLoad(); - Hidden = false; - - Util.hidePanel(); - Util.show(TerminalId); - - KeyBinding.unSet(); - - Term.resume(); + Hidden = false; + /* only if panel was hided */ + var lHided = Util.hidePanel(); + if(lHided){ + Util.show(TerminalId); + + KeyBinding.unSet(); + + Term.resume(); + } }); JqueryTerminal.hide = (function(){