Revert "Fix: reload page after file upload completed"

This reverts commit 368af101ef.
This commit is contained in:
Laurent Destailleur 2012-06-01 02:07:11 +02:00
parent 3dcf553a47
commit 180908bfe1

View File

@ -39,38 +39,16 @@ window.locale = {
$(function () {
'use strict';
var max_file_size = '<?php echo $max_file_size; ?>';
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload();
// Options
$('#fileupload').fileupload('option', {
maxFileSize: '<?php echo $max_file_size; ?>'
maxFileSize: max_file_size
});
// Events
$('#fileupload')
.bind('fileuploaddestroy', function (e, data) {
var that = $(this).data("fileupload");
if ( confirm("Delete this file ?") == true ) {
if (data.url) {
$.ajax(data).success(function () {
that._adjustMaxNumberOfFiles(1);
$(this).fadeOut(function () {
$(this).remove();
});
});
} else {
data.context.fadeOut(function () {
$(this).remove();
});
}
}
})
.bind('fileuploadcompleted', function (e, data) {
$.ajax(data).success(function () {
location.href='<?php echo $_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"]; ?>';
});
});
});
</script>
<!-- END TEMPLATE FILE UPLOAD MAIN -->