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
|
2022-04-12 16:01:27 +03:00
|
|
|
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;
|
|
|
|
}
|
2022-04-12 16:01:27 +03:00
|
|
|
|
|
|
|
@action
|
|
|
|
onValueChange(property, value) {
|
|
|
|
this.args.newsletter[property] = value;
|
|
|
|
}
|
2022-04-19 22:01:08 +03:00
|
|
|
|
|
|
|
@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
|
|
|
}
|