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