do no offer 'undo delete' on opera

opera lacks the onunload to make it work
This commit is contained in:
Robin Appelman 2012-04-15 15:48:02 +02:00
parent cdf9f8c42a
commit 75a4e46872
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,5 @@
FileList={ FileList={
useUndo:true,
update:function(fileListHtml) { update:function(fileListHtml) {
$('#fileList').empty().html(fileListHtml); $('#fileList').empty().html(fileListHtml);
}, },
@ -163,7 +164,7 @@ FileList={
}); });
}, },
do_delete:function(files){ do_delete:function(files){
if(FileList.deleteFiles){//finish any ongoing deletes first if(FileList.deleteFiles || !FileList.useUndo){//finish any ongoing deletes first
FileList.finishDelete(function(){ FileList.finishDelete(function(){
FileList.do_delete(files); FileList.do_delete(files);
}); });
@ -196,7 +197,6 @@ FileList={
boolOperationFinished(data, function(){ boolOperationFinished(data, function(){
$('#notification').fadeOut(); $('#notification').fadeOut();
$.each(FileList.deleteFiles,function(index,file){ $.each(FileList.deleteFiles,function(index,file){
// alert(file);
FileList.remove(file); FileList.remove(file);
}); });
FileList.deleteCanceled=true; FileList.deleteCanceled=true;
@ -225,7 +225,7 @@ $(document).ready(function(){
} }
$('#notification').fadeOut(); $('#notification').fadeOut();
}); });
FileList.useUndo=('onbeforeunload' in window)
$(window).bind('beforeunload', function (){ $(window).bind('beforeunload', function (){
FileList.finishDelete(null,true); FileList.finishDelete(null,true);
}); });