Ghost/ghost/admin/app/components/announcement-settings/content.js
2023-04-20 14:05:37 +04:00

24 lines
584 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {debounce} from '@ember/runloop';
import {inject as service} from '@ember/service';
export default class AnnouncementSettingsContentComponent extends Component {
@service settings;
get content() {
return this.settings.announcementContent;
}
updatePreview() {
debounce(this, this.args.onChange, 300);
}
@action
setContent(html) {
this.settings.announcementContent = html;
this.settings.save();
this.updatePreview();
}
}