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