discourse/app/assets/javascripts/admin/controllers/admin-email-preview-digest.js.es6
2016-03-31 17:40:54 -04:00

22 lines
503 B
JavaScript

import EmailPreview from 'admin/models/email-preview';
export default Ember.Controller.extend({
actions: {
refresh() {
const model = this.get('model');
this.set('loading', true);
EmailPreview.findDigest(this.get('lastSeen'), this.get('username')).then(email => {
model.setProperties(email.getProperties('html_content', 'text_content'));
this.set('loading', false);
});
},
toggleShowHtml() {
this.toggleProperty('showHtml');
}
}
});