discourse/app/assets/javascripts/wizard/components/image-preview-large-icon.js
2020-09-04 13:42:47 +02:00

25 lines
548 B
JavaScript

import { observes } from "discourse-common/utils/decorators";
import { createPreviewComponent } from "wizard/lib/preview";
export default createPreviewComponent(325, 125, {
ios: null,
image: null,
@observes("field.value")
imageChanged() {
this.reload();
},
images() {
return {
ios: "/images/wizard/apple-mask.png",
image: this.get("field.value"),
};
},
paint(ctx, colors, font, width, height) {
this.scaleImage(this.image, 10, 8, 87, 87);
this.scaleImage(this.ios, 0, 0, width, height);
},
});