discourse/app/assets/javascripts/wizard/addon/components/image-preview-large-icon.js
Jarek Radosz fcb4e5a1a1
DEV: Make wizard an ember addon (#17027)
Co-authored-by: David Taylor <david@taylorhq.com>
2022-06-17 14:50:21 +02:00

26 lines
562 B
JavaScript

import { createPreviewComponent } from "wizard/lib/preview";
import { observes } from "discourse-common/utils/decorators";
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(options) {
const { width, height } = options;
this.scaleImage(this.image, 10, 8, 87, 87);
this.scaleImage(this.ios, 0, 0, width, height);
},
});