discourse/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6

22 lines
503 B
Text
Raw Normal View History

import EmailPreview from 'admin/models/email-preview';
export default Ember.Controller.extend({
2013-09-16 14:08:55 -04:00
actions: {
2015-08-16 05:51:31 -04:00
refresh() {
const model = this.get('model');
2013-09-16 14:08:55 -04:00
2015-08-16 06:01:04 -04:00
this.set('loading', true);
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 05:51:31 -04:00
this.set('loading', false);
2013-09-16 14:08:55 -04:00
});
},
2015-08-16 05:51:31 -04:00
toggleShowHtml() {
2013-09-16 14:08:55 -04:00
this.toggleProperty('showHtml');
}
}
});