Skip to content
Snippets Groups Projects
Commit 1592764a authored by Björn Schießle's avatar Björn Schießle
Browse files

show a spinner instead of the delete button while moving files to the trash bin

parent e6f1544f
No related branches found
No related tags found
No related merge requests found
...@@ -111,6 +111,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; } ...@@ -111,6 +111,7 @@ table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
} }
#fileList .fileactions a.action img { position:relative; top:.2em; } #fileList .fileactions a.action img { position:relative; top:.2em; }
#fileList a.action { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; } #fileList a.action { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; }
#fileList img.move2trash { display:inline; margin:-.5em 0; padding:1em .5em 1em .5em !important; float:right; }
a.action.delete { float:right; } a.action.delete { float:right; }
a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; }
.selectedActions { display:none; float:right; } .selectedActions { display:none; float:right; }
......
...@@ -271,13 +271,20 @@ var FileList={ ...@@ -271,13 +271,20 @@ var FileList={
} }
}, },
do_delete:function(files){ do_delete:function(files){
if(files.substr){
files=[files];
}
for (var i in files) {
var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date").children(".action.delete");
var oldHTML = deleteAction[0].outerHTML;
var newHTML = '<img class="move2trash" data-action="Delete" title="move file to the trash bin" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
deleteAction[0].outerHTML = newHTML;
}
// Finish any existing actions // Finish any existing actions
if (FileList.lastAction) { if (FileList.lastAction) {
FileList.lastAction(); FileList.lastAction();
} }
if(files.substr){
files=[files];
}
var fileNames = JSON.stringify(files); var fileNames = JSON.stringify(files);
$.post(OC.filePath('files', 'ajax', 'delete.php'), $.post(OC.filePath('files', 'ajax', 'delete.php'),
{dir:$('#dir').val(),files:fileNames}, {dir:$('#dir').val(),files:fileNames},
...@@ -290,6 +297,11 @@ var FileList={ ...@@ -290,6 +297,11 @@ var FileList={
files.removeClass('selected'); files.removeClass('selected');
}); });
procesSelection(); procesSelection();
} else {
$.each(files,function(index,file) {
var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash");
deleteAction[0].outerHTML = oldHTML;
});
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment