Ghost/ghost/admin/app/components/modals/newsletters/edit/settings.js

38 lines
901 B
JavaScript
Raw Normal View History

2022-04-04 21:26:49 +03:00
import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class EditNewsletterSettingsForm extends Component {
@service settings;
@action
onCheckboxChange(property, event) {
2022-04-04 21:26:49 +03:00
this.args.newsletter[property] = event.target.checked;
}
@action
toggleProperty(property) {
this.args.newsletter[property] = !this.args.newsletter[property];
}
@action
onInput(property, event) {
this.args.newsletter[property] = event.target.value;
}
@action
onValueChange(property, value) {
this.args.newsletter[property] = value;
}
@action
setOptInExisting(event) {
this.args.setOptInExisting(event.target.value);
}
@action
toggleOptInExisting() {
this.args.setOptInExisting(!this.args.optInExisting);
}
2022-04-04 21:26:49 +03:00
}