discourse/app/assets/javascripts/wizard/components/image-preview-apple-touch-i...

22 lines
525 B
Plaintext
Raw Normal View History

2016-09-19 14:24:37 -04:00
import { observes } from 'ember-addons/ember-computed-decorators';
import { createPreviewComponent } from 'wizard/lib/preview';
2016-09-19 14:24:37 -04:00
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') };
2016-09-19 14:24:37 -04:00
},
paint(ctx, colors, width, height) {
ctx.drawImage(this.image, 10, 8, 87, 87);
ctx.drawImage(this.ios, 0, 0, width, height);
}
});