discourse/app/assets/javascripts/wizard/components/image-preview-apple-touch-icon.js.es6

25 lines
545 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import { observes } from "ember-addons/ember-computed-decorators";
import { createPreviewComponent } from "wizard/lib/preview";
2016-09-20 02:24:37 +08:00
export default createPreviewComponent(325, 125, {
ios: null,
image: null,
2018-06-15 23:03:24 +08:00
@observes("field.value")
2016-09-20 02:24:37 +08:00
imageChanged() {
this.reload();
},
images() {
2018-06-15 23:03:24 +08:00
return {
ios: "/images/wizard/apple-mask.png",
image: this.get("field.value")
};
2016-09-20 02:24:37 +08:00
},
paint(ctx, colors, width, height) {
this.scaleImage(this.image, 10, 8, 87, 87);
this.scaleImage(this.ios, 0, 0, width, height);
2016-09-20 02:24:37 +08:00
}
});