2019-11-07 16:38:28 -05:00
|
|
|
import { observes } from "discourse-common/utils/decorators";
|
2018-06-15 11:03:24 -04:00
|
|
|
import { createPreviewComponent } from "wizard/lib/preview";
|
2016-09-19 14:24:37 -04:00
|
|
|
|
|
|
|
export default createPreviewComponent(325, 125, {
|
|
|
|
ios: null,
|
|
|
|
image: null,
|
|
|
|
|
2018-06-15 11:03:24 -04:00
|
|
|
@observes("field.value")
|
2016-09-19 14:24:37 -04:00
|
|
|
imageChanged() {
|
|
|
|
this.reload();
|
|
|
|
},
|
|
|
|
|
2016-09-21 16:09:18 -04:00
|
|
|
images() {
|
2018-06-15 11:03:24 -04:00
|
|
|
return {
|
|
|
|
ios: "/images/wizard/apple-mask.png",
|
|
|
|
image: this.get("field.value")
|
|
|
|
};
|
2016-09-19 14:24:37 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
paint(ctx, colors, width, height) {
|
2016-09-21 16:48:48 -04:00
|
|
|
this.scaleImage(this.image, 10, 8, 87, 87);
|
|
|
|
this.scaleImage(this.ios, 0, 0, width, height);
|
2016-09-19 14:24:37 -04:00
|
|
|
}
|
|
|
|
});
|