minor changes

This commit is contained in:
coderaiser 2012-10-02 10:05:06 -04:00
parent 3b26faa3d2
commit 2b28a44fac
4 changed files with 38 additions and 20 deletions

View file

@ -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){

View file

@ -2,7 +2,7 @@
"cache" : {"allowed" : false},
"appcache" : false,
"minification" : {
"js" : true,
"js" : false,
"css" : true,
"html" : true,
"img" : true

View file

@ -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;

View file

@ -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(){