mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
Use checklist checkbox for the custom field checkbox
This commit is contained in:
parent
b9338a78f4
commit
f476143e92
4 changed files with 18 additions and 28 deletions
|
@ -53,23 +53,12 @@ template(name="cardCustomField-number")
|
|||
= value
|
||||
|
||||
template(name="cardCustomField-checkbox")
|
||||
if canModifyCard
|
||||
+inlinedForm(classNames="js-card-customfield-checkbox")
|
||||
input.materialCheckBox(type="checkbox" checked=data.value)
|
||||
.edit-controls.clearfix
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
a.fa.fa-times-thin.js-close-inlined-form
|
||||
.js-checklist-item.checklist-item(class="{{#if data.value }}is-checked{{/if}}")
|
||||
if canModifyCard
|
||||
.check-box-container
|
||||
.check-box.materialCheckBox(class="{{#if data.value }}is-checked{{/if}}")
|
||||
else
|
||||
a.js-open-inlined-form.checkbox-display
|
||||
if value
|
||||
i.fa.fa-check-square
|
||||
else
|
||||
i.fa.fa-square
|
||||
else
|
||||
if value
|
||||
i.fa.fa-check-square
|
||||
else
|
||||
i.fa.fa-square
|
||||
.materialCheckBox(class="{{#if data.value }}is-checked{{/if}}")
|
||||
|
||||
template(name="cardCustomField-currency")
|
||||
if canModifyCard
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
@ -8,3 +8,8 @@ template(name="dateBadge")
|
|||
time(datetime="{{showISODate}}")
|
||||
| {{showDate}}
|
||||
|
||||
template(name="dateCustomField")
|
||||
a(title="{{showTitle}}" class="{{classes}}")
|
||||
time(datetime="{{showISODate}}")
|
||||
| {{showDate}}
|
||||
|
||||
|
|
|
@ -242,11 +242,11 @@ textarea
|
|||
margin: 3px 4px
|
||||
|
||||
// Material Design checkboxes
|
||||
//[type="checkbox"]:not(:checked),
|
||||
//[type="checkbox"]:checked
|
||||
// position: absolute
|
||||
// left: -9999px
|
||||
// visibility: hidden
|
||||
[type="checkbox"]:not(:checked),
|
||||
[type="checkbox"]:checked
|
||||
position: absolute
|
||||
left: -9999px
|
||||
visibility: hidden
|
||||
|
||||
.materialCheckBox
|
||||
position: relative
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue