diff --git a/frappe_better_attach_control/public/js/better_attach_image.bundle.js b/frappe_better_attach_control/public/js/better_attach_image.bundle.js index b1ccabb..5881f67 100644 --- a/frappe_better_attach_control/public/js/better_attach_image.bundle.js +++ b/frappe_better_attach_control/public/js/better_attach_image.bundle.js @@ -1,33 +1,27 @@ frappe.ui.form.ControlAttachImage = class ControlAttachImage extends frappe.ui.form.ControlAttachImage { - on_attach_click() { - this.set_upload_options(); - this.file_uploader = new frappe.ui.FileUploader(this.upload_options); - } - on_attach_doc_image() { - this.set_upload_options(); - if (this.upload_options.restrictions.allowed_file_types == null) { - this.upload_options.restrictions.allowed_file_types = ['image/*']; - } - if (this.upload_options.restrictions.crop_image_aspect_ratio == null) { - this.upload_options.restrictions.crop_image_aspect_ratio = 1; + make_input() { + super.make_input(); + if (!this.__is_custom) { + console.error('The Attach Image control doesn\'t extend the plugin Attach control.'); } - this.file_uploader = new frappe.ui.FileUploader(this.upload_options); + + // @todo: Bellow support for multiple files upload + /*let $file_link = this.$value.find('.attached-file-link'); + $file_link.popover({ + trigger: 'hover', + placement: 'top', + content: () => { + return `