mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-28 18:23:35 +00:00
refactored
This commit is contained in:
parent
5eaf783c83
commit
856d9bb293
7 changed files with 60 additions and 117 deletions
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue