mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 20:07:52 -05:00
28 lines
670 B
JavaScript
28 lines
670 B
JavaScript
/**
|
|
This controller previews an email digest
|
|
|
|
@class AdminEmailPreviewDigestController
|
|
@extends Discourse.ObjectController
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
export default Discourse.ObjectController.extend({
|
|
|
|
actions: {
|
|
refresh: function() {
|
|
var model = this.get('model'),
|
|
self = this;
|
|
|
|
self.set('loading', true);
|
|
Discourse.EmailPreview.findDigest(this.get('lastSeen')).then(function (email) {
|
|
model.setProperties(email.getProperties('html_content', 'text_content'));
|
|
self.set('loading', false);
|
|
});
|
|
},
|
|
|
|
toggleShowHtml: function() {
|
|
this.toggleProperty('showHtml');
|
|
}
|
|
}
|
|
|
|
});
|