mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 03:17:53 -05:00
30 lines
712 B
JavaScript
30 lines
712 B
JavaScript
import ObjectController from 'discourse/controllers/object';
|
|
|
|
/**
|
|
This controller previews an email digest
|
|
|
|
@class AdminEmailPreviewDigestController
|
|
@extends ObjectController
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
export default 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');
|
|
}
|
|
}
|
|
|
|
});
|