mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 08:54:10 +00:00
minor changes
This commit is contained in:
parent
85217165b4
commit
1b30208478
2 changed files with 25 additions and 19 deletions
|
|
@ -1275,24 +1275,32 @@ var CloudCommander, Util,
|
|||
lParent = lCurrent.parentElement,
|
||||
lName = DOM.getCurrentName(lCurrent),
|
||||
lUrl = DOM.getCurrentPath(lCurrent);
|
||||
|
||||
if( DOM.isCurrentIsDir(lCurrent) )
|
||||
lUrl += '?dir';
|
||||
|
||||
if(lCurrent && lParent && lName !== '..'){
|
||||
DOM.ajax({
|
||||
method : 'DELETE',
|
||||
url : lUrl,
|
||||
error : DOM.Images.showError,
|
||||
success : function(pData){
|
||||
var lNext = lCurrent.nextSibling,
|
||||
lPrevious = lCurrent.previousSibling;
|
||||
|
||||
if(lNext)
|
||||
DOM.setCurrentFile(lNext);
|
||||
else if(lPrevious)
|
||||
DOM.setCurrentFile(lPrevious);
|
||||
|
||||
lParent.removeChild(lCurrent);
|
||||
Util.log(pData);
|
||||
}
|
||||
DOM.Images.showLoad();
|
||||
CloudCommander.getConfig(function(pConfig){
|
||||
lUrl = pConfig && pConfig.api_url + lUrl;
|
||||
DOM.ajax({
|
||||
method : 'DELETE',
|
||||
url : lUrl,
|
||||
error : DOM.Images.showError,
|
||||
success : function(pData){
|
||||
var lNext = lCurrent.nextSibling,
|
||||
lPrevious = lCurrent.previousSibling;
|
||||
|
||||
DOM.Images.hideLoad();
|
||||
if(lNext)
|
||||
DOM.setCurrentFile(lNext);
|
||||
else if(lPrevious)
|
||||
DOM.setCurrentFile(lPrevious);
|
||||
|
||||
lParent.removeChild(lCurrent);
|
||||
Util.log(pData);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@
|
|||
var p = pParams,
|
||||
lQuery = main.getQuery(p.request);
|
||||
|
||||
p.name = Util.removeStr(pParams.name, CloudFunc.FS) || '/';
|
||||
p.name = Util.removeStr(pParams.name, [CloudFunc.FS, '?dir']) || '/';
|
||||
switch(p.method){
|
||||
case 'GET':
|
||||
fs.stat(p.name, function(pError, pStat){
|
||||
|
|
@ -133,8 +133,6 @@
|
|||
break;
|
||||
|
||||
case 'PUT':
|
||||
p.name = Util.removeStr(p.name, '?dir');
|
||||
|
||||
if(lQuery === 'dir')
|
||||
fs.mkdir(p.name, function(pError){
|
||||
if(!pError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue