refactored

This commit is contained in:
coderaiser 2012-12-14 10:55:19 -05:00
parent 5eaf783c83
commit 856d9bb293
7 changed files with 60 additions and 117 deletions

View file

@ -121,23 +121,11 @@ var CloudCommander, Util, DOM, CodeMirror;
if(Loading)
return;
/* getting link */
var lCurrentFile = DOM.getCurrentFile(),
lPath = DOM.getCurrentPath(lCurrentFile);
/* checking is this link is to directory */
var lSize = DOM.getByClass('size', lCurrentFile);
if(lSize){
lSize = lSize[0].textContent;
/* when folder view
* is no need to edit
* data
*/
if (lSize === '<dir>')
ReadOnly = true;
}
/* checking is this link is to directory
* when folder view is no need to edit data
*/
if ( DOM.getCurrentSize() === '<dir>' )
ReadOnly = true;
Loading = true;
setTimeout(function(){
@ -153,7 +141,7 @@ var CloudCommander, Util, DOM, CodeMirror;
success : function(data){
/* if we got json - show it */
if(typeof data === 'object')
if( Util.isObject(data) )
data = JSON.stringify(data, null, 4);
var lHided = DOM.hidePanel();
@ -184,7 +172,6 @@ var CloudCommander, Util, DOM, CodeMirror;
DOM.showPanel();
}
/**
* function calls all CodeMirror editor functions
*/