Fix: reload page after file upload completed
This commit is contained in:
parent
8c4ddb99be
commit
1649a9a1b1
@ -39,16 +39,38 @@ window.locale = {
|
|||||||
$(function () {
|
$(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var max_file_size = '<?php echo $max_file_size; ?>';
|
|
||||||
|
|
||||||
// Initialize the jQuery File Upload widget:
|
// Initialize the jQuery File Upload widget:
|
||||||
$('#fileupload').fileupload();
|
$('#fileupload').fileupload();
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
$('#fileupload').fileupload('option', {
|
$('#fileupload').fileupload('option', {
|
||||||
maxFileSize: max_file_size
|
maxFileSize: '<?php echo $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>
|
</script>
|
||||||
<!-- END TEMPLATE FILE UPLOAD MAIN -->
|
<!-- END TEMPLATE FILE UPLOAD MAIN -->
|
||||||
Loading…
Reference in New Issue
Block a user