mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
added update of size on file changing in editor
This commit is contained in:
parent
0d41e2f934
commit
199d61cce9
3 changed files with 24 additions and 5 deletions
|
|
@ -26,7 +26,9 @@ and get them out to file system.
|
|||
* If create directory command executed - loading spinner
|
||||
would be on top.
|
||||
|
||||
* Refactored getShortSize
|
||||
* Refactored getShortSize.
|
||||
|
||||
* Added update of size on file changing in editor.
|
||||
|
||||
|
||||
2012.03.01, Version 0.1.9
|
||||
|
|
|
|||
|
|
@ -970,7 +970,7 @@ var CloudCommander, Util,
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* get size
|
||||
* @pCurrentFile
|
||||
*/
|
||||
DOM.getCurrentSize = function(pCurrentFile){
|
||||
|
|
@ -984,6 +984,19 @@ var CloudCommander, Util,
|
|||
return lRet;
|
||||
};
|
||||
|
||||
/**
|
||||
* set size
|
||||
* @pCurrentFile
|
||||
*/
|
||||
DOM.setCurrentSize = function(pSize, pCurrentFile){
|
||||
var lCurrent = pCurrentFile || DOM.getCurrentFile(),
|
||||
lSizeElement = DOM.getByClass('size', lCurrent),
|
||||
lSize = CloudFunc.getShortSize(pSize);
|
||||
|
||||
lSizeElement[0].textContent = lSize;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* @pCurrentFile
|
||||
|
|
|
|||
|
|
@ -55,7 +55,8 @@ var CloudCommander, Util, DOM, CodeMirror;
|
|||
FM = DOM.getFM();
|
||||
|
||||
var lCSS = setCSS(),
|
||||
lPath = DOM.getCurrentPath();
|
||||
lCurrent = DOM.getCurrentFile(),
|
||||
lPath = DOM.getCurrentPath( lCurrent );
|
||||
|
||||
CodeMirrorElement = DOM.anyload({
|
||||
name : 'div',
|
||||
|
|
@ -78,8 +79,11 @@ var CloudCommander, Util, DOM, CodeMirror;
|
|||
Util.exec(pParams);
|
||||
DOM.remove(lCSS, document.head);
|
||||
},
|
||||
'Ctrl-S': function(){
|
||||
DOM.RESTfull.save(lPath, lEditor.getValue());
|
||||
'Ctrl-S': function(){
|
||||
var lValue = lEditor.getValue();
|
||||
|
||||
DOM.setCurrentSize( lValue.length, lCurrent );
|
||||
DOM.RESTfull.save( lPath, lValue );
|
||||
}
|
||||
},
|
||||
readOnly : ReadOnly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue