mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-25 16:19:59 +08:00
Removing the selected image and clearing the dropdzone on dialog close.
Towards #741 Signed-off-by: Abijeet <abijeetpatro@gmail.com>
This commit is contained in:
@ -12,7 +12,7 @@ const props = ['placeholder', 'uploadUrl', 'uploadedTo'];
|
||||
function mounted() {
|
||||
let container = this.$el;
|
||||
let _this = this;
|
||||
new DropZone(container, {
|
||||
this._dz = new DropZone(container, {
|
||||
addRemoveLinks: true,
|
||||
dictRemoveFile: trans('components.image_upload_remove'),
|
||||
url: function() {
|
||||
@ -51,12 +51,19 @@ function mounted() {
|
||||
}
|
||||
|
||||
function data() {
|
||||
return {}
|
||||
return {};
|
||||
}
|
||||
|
||||
const methods = {
|
||||
onClose: function () {
|
||||
this._dz.removeAllFiles(true);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
template,
|
||||
props,
|
||||
mounted,
|
||||
data,
|
||||
methods
|
||||
};
|
||||
|
Reference in New Issue
Block a user