Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-14 13:52:54 +01:00
517da30a4c
* Move from jquery uploads to uppy.js * Apply prettier and update version
24 Zeilen
674 B
JavaScript
24 Zeilen
674 B
JavaScript
import UppyUploadMixin from "discourse/mixins/uppy-upload";
|
|
import Component from "@ember/component";
|
|
import { computed } from "@ember/object";
|
|
|
|
export default Component.extend(UppyUploadMixin, {
|
|
classNames: ["wizard-field-upload"],
|
|
classNameBindings: ["isImage"],
|
|
uploading: false,
|
|
type: computed(function () {
|
|
return `wizard_${this.field.id}`;
|
|
}),
|
|
isImage: computed("field.value.extension", function () {
|
|
return (
|
|
this.field.value &&
|
|
this.siteSettings.wizard_recognised_image_upload_formats
|
|
.split("|")
|
|
.includes(this.field.value.extension)
|
|
);
|
|
}),
|
|
|
|
uploadDone(upload) {
|
|
this.set("field.value", upload);
|
|
},
|
|
});
|