Use checklist checkbox for the custom field checkbox

This commit is contained in:
John R. Supplee 2021-01-19 15:28:01 +02:00
parent b9338a78f4
commit f476143e92
4 changed files with 18 additions and 28 deletions

View file

@ -86,18 +86,14 @@ CardCustomField.register('cardCustomField');
super.onCreated();
}
isNull() {
return !this.data().value;
toggleItem() {
this.card.setCustomField(this.customFieldId, !this.data().value);
}
events() {
return [
{
'submit .js-card-customfield-checkbox'(event) {
event.preventDefault();
const value = this.find('input').checked;
this.card.setCustomField(this.customFieldId, value);
},
'click .js-checklist-item .check-box-container': this.toggleItem,
},
];
}