Skip to content

Commit

Permalink
Update to v1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kid1194 committed Aug 21, 2022
1 parent 1c20555 commit ef17302
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions frappe_better_attach_control/public/js/better_attach.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ frappe.ui.form.ControlAttach = class ControlAttach extends frappe.ui.form.Contro
on_attach_click() {
$log('Attaching file');
this.set_upload_options();
this.file_uploader = new frappe.ui.FileUploader(this.upload_options);
this.file_uploader = new frappe.ui.FileUploader(!this._images_only ? this.upload_options : this.image_upload_options);
}
on_attach_doc_image() {
$log('Attaching image');
Expand Down Expand Up @@ -200,11 +200,9 @@ frappe.ui.form.ControlAttach = class ControlAttach extends frappe.ui.form.Contro
if (isDataObject(this._options)) {
Object.assign(options, this._options);
}
this.upload_options = this.image_upload_options = options;
if (this._images_only) {
this.image_upload_options = deepCloneObject(options);
this._parse_image_types(this.image_upload_options.restrictions);
}
this.upload_options = options;
this.image_upload_options = deepCloneObject(options);
this._parse_image_types(this.image_upload_options.restrictions);
}
_value_to_array(value, def) {
let val = value;
Expand Down

0 comments on commit ef17302

Please sign in to comment.