do no offer 'undo delete' on opera
opera lacks the onunload to make it work
This commit is contained in:
parent
cdf9f8c42a
commit
75a4e46872
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue