Fix deletion for browser that do not support onBeforeUnload, fixes oc-1534.

This commit is contained in:
Arthur Schiwon 2012-08-20 17:24:10 +02:00
parent cb0464ca4e
commit ef3eebfd3e
1 changed files with 24 additions and 17 deletions

View File

@ -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);
};
}
}