close #931 Fixed: Bulk action delete not working
This commit is contained in:
31
resources/assets/js/plugins/bulk-action.js
vendored
31
resources/assets/js/plugins/bulk-action.js
vendored
@ -80,14 +80,41 @@ export default class BulkAction {
|
||||
.then(response => {
|
||||
//this.loading = false;
|
||||
//this.modal = false;
|
||||
if (response.data.redirect) {
|
||||
window.location.reload(false);
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.modal = false;
|
||||
|
||||
window.location.reload(false);
|
||||
// It is necessary to create a new blob object with mime-type explicitly set
|
||||
// otherwise only Chrome works like it should
|
||||
var newBlob = new Blob([response.body], {type: 'application/pdf'})
|
||||
|
||||
// IE doesn't allow using a blob object directly as link href
|
||||
// instead it is necessary to use msSaveOrOpenBlob
|
||||
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
|
||||
window.navigator.msSaveOrOpenBlob(newBlob)
|
||||
return
|
||||
}
|
||||
|
||||
// For other browsers:
|
||||
// Create a link pointing to the ObjectURL containing the blob.
|
||||
const data = window.URL.createObjectURL(newBlob)
|
||||
var link = document.createElement('a')
|
||||
link.href = data
|
||||
link.download = filename + '.pdf'
|
||||
link.click()
|
||||
setTimeout(function () {
|
||||
// For Firefox it is necessary to delay revoking the ObjectURL
|
||||
window.URL.revokeObjectURL(data)
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
//this.loading = false;
|
||||
//this.modal = false;
|
||||
|
||||
window.location.reload(false);
|
||||
//window.location.reload(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user