mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
Add Apple Icon preview
This commit is contained in:
parent
e7c1962aa0
commit
598db7a81c
|
@ -0,0 +1,35 @@
|
|||
import { observes } from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
import {
|
||||
createPreviewComponent,
|
||||
loadImage,
|
||||
} from 'wizard/lib/preview';
|
||||
|
||||
export default createPreviewComponent(325, 125, {
|
||||
ios: null,
|
||||
image: null,
|
||||
|
||||
@observes('field.value')
|
||||
imageChanged() {
|
||||
this.reload();
|
||||
},
|
||||
|
||||
load() {
|
||||
return Ember.RSVP.Promise.all([
|
||||
loadImage('/images/wizard/apple-mask.png'),
|
||||
loadImage(this.get('field.value'))
|
||||
]).then(result => {
|
||||
this.ios = result[0];
|
||||
this.image = result[1];
|
||||
});
|
||||
|
||||
return loadImage(this.get('field.value')).then(image => {
|
||||
this.image = image;
|
||||
});
|
||||
},
|
||||
|
||||
paint(ctx, colors, width, height) {
|
||||
ctx.drawImage(this.image, 10, 8, 87, 87);
|
||||
ctx.drawImage(this.ios, 0, 0, width, height);
|
||||
}
|
||||
});
|
|
@ -16,8 +16,8 @@ export default createPreviewComponent(371, 124, {
|
|||
|
||||
load() {
|
||||
return Ember.RSVP.Promise.all([
|
||||
loadImage('/images/wizard/tab.png'),
|
||||
loadImage(this.get('field.value'))
|
||||
loadImage('/images/wizard/tab.png'),
|
||||
loadImage(this.get('field.value'))
|
||||
]).then(result => {
|
||||
this.tab = result[0];
|
||||
this.image = result[1];
|
||||
|
|
BIN
public/images/wizard/apple-mask.png
Normal file
BIN
public/images/wizard/apple-mask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
Loading…
Reference in New Issue
Block a user