2016-04-01 05:33:25 +08:00
|
|
|
import EmailPreview from 'admin/models/email-preview';
|
|
|
|
|
2015-08-12 00:27:07 +08:00
|
|
|
export default Ember.Controller.extend({
|
2013-06-04 04:12:24 +08:00
|
|
|
|
2013-09-17 02:08:55 +08:00
|
|
|
actions: {
|
2015-08-16 17:51:31 +08:00
|
|
|
refresh() {
|
|
|
|
const model = this.get('model');
|
2013-09-17 02:08:55 +08:00
|
|
|
|
2015-08-16 18:01:04 +08:00
|
|
|
this.set('loading', true);
|
2016-04-01 05:33:25 +08:00
|
|
|
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
|
2013-09-17 02:08:55 +08:00
|
|
|
model.setProperties(email.getProperties('html_content', 'text_content'));
|
2015-08-16 17:51:31 +08:00
|
|
|
this.set('loading', false);
|
2013-09-17 02:08:55 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2015-08-16 17:51:31 +08:00
|
|
|
toggleShowHtml() {
|
2013-09-17 02:08:55 +08:00
|
|
|
this.toggleProperty('showHtml');
|
|
|
|
}
|
2013-06-04 04:12:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|