fix leaving page issue
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -42,11 +42,6 @@ $(document).ready(function() {
|
|||||||
$('.upload-progress', $(li)).show();
|
$('.upload-progress', $(li)).show();
|
||||||
$('.upload-progress .bar', $(li)).css('width', pc + "%");
|
$('.upload-progress .bar', $(li)).css('width', pc + "%");
|
||||||
$('.upload-progress span ').empty().append(pc + "%");
|
$('.upload-progress span ').empty().append(pc + "%");
|
||||||
|
|
||||||
|
|
||||||
$(window).bind('beforeunload', function(){
|
|
||||||
return 'File are still uploading';
|
|
||||||
});
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
xhr.onreadystatechange = function(e) {
|
xhr.onreadystatechange = function(e) {
|
||||||
@ -60,6 +55,7 @@ $(document).ready(function() {
|
|||||||
$(li).html('<span>Error (' + xhr.status + ') during upload of file ' + file.name + '</span>');
|
$(li).html('<span>Error (' + xhr.status + ') during upload of file ' + file.name + '</span>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// file uploaded successfully, remove from queue
|
||||||
var index = queue.indexOf(xhr);
|
var index = queue.indexOf(xhr);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
queue.splice(index, 1);
|
queue.splice(index, 1);
|
||||||
|
Reference in New Issue
Block a user