summaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-28 08:12:08 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-29 20:16:39 +0200
commitcbaf858dea0f2094805edb6aa223bdd6877fff5b (patch)
tree9da83c325bb6ab94160bec964b8ef64aeda745ae /apps/files/js/filelist.js
parent3b9fac8f81b76af988ea620a207e6c65fa665589 (diff)
parent80374c7cb2f3c98e350c95f92a9785aacef5d2c4 (diff)
downloadnextcloud-server-cbaf858dea0f2094805edb6aa223bdd6877fff5b.tar.gz
nextcloud-server-cbaf858dea0f2094805edb6aa223bdd6877fff5b.zip
Merge remote-tracking branch 'gitorious/master' into routing
Conflicts: apps/files/js/fileactions.js apps/files_archive/js/archive.js
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js42
1 files changed, 25 insertions, 17 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 0bfc810baf2..7c97f82488d 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -151,7 +151,7 @@ FileList={
}
});
}
-
+
}
tr.attr('data-file', newname);
var path = td.children('a.name').attr('href');
@@ -189,7 +189,7 @@ FileList={
FileList.replaceCanceled = false;
FileList.replaceOldName = oldName;
FileList.replaceNewName = newName;
- FileList.lastAction = function() {
+ FileList.lastAction = function() {
FileList.finishReplace();
};
$('#notification').html(t('files', 'replaced')+' '+newName+' '+t('files', 'with')+' '+oldName+'<span class="undo">'+t('files', 'undo')+'</span>');
@@ -236,23 +236,13 @@ FileList={
do_delete:function(files){
// Finish any existing actions
if (FileList.lastAction || !FileList.useUndo) {
+ if(!FileList.deleteFiles) {
+ FileList.prepareDeletion(files);
+ }
FileList.lastAction();
+ return;
}
- if(files.substr){
- files=[files];
- }
- $.each(files,function(index,file){
- var files = $('tr').filterAttr('data-file',file);
- files.hide();
- files.find('input[type="checkbox"]').removeAttr('checked');
- files.removeClass('selected');
- });
- procesSelection();
- FileList.deleteCanceled=false;
- FileList.deleteFiles=files;
- FileList.lastAction = function() {
- FileList.finishDelete(null, true);
- };
+ FileList.prepareDeletion(files);
$('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
$('#notification').fadeIn();
},
@@ -279,6 +269,23 @@ FileList={
}
});
}
+ },
+ prepareDeletion:function(files){
+ if(files.substr){
+ files=[files];
+ }
+ $.each(files,function(index,file){
+ var files = $('tr').filterAttr('data-file',file);
+ files.hide();
+ files.find('input[type="checkbox"]').removeAttr('checked');
+ files.removeClass('selected');
+ });
+ procesSelection();
+ FileList.deleteCanceled=false;
+ FileList.deleteFiles=files;
+ FileList.lastAction = function() {
+ FileList.finishDelete(null, true);
+ };
}
}
@@ -297,6 +304,7 @@ $(document).ready(function(){
FileList.replaceOldName = null;
FileList.replaceNewName = null;
}
+ FileList.lastAction = null;
$('#notification').fadeOut();
});
$('#notification .replace').live('click', function() {