Add two way binding of checklists

This commit is contained in:
Andrés Manelli 2018-04-18 00:59:22 -03:00
parent b2e175ba8c
commit 49c415f023
4 changed files with 37 additions and 13 deletions

View file

@ -6,7 +6,7 @@ template(name="editCardSpentTime")
input.js-time-field#time(type="number" step="0.01" name="time" value="{{card.getSpentTime}}" placeholder=timeFormat autofocus)
label(for="overtime") {{_ 'overtime'}}
a.js-toggle-overtime
.materialCheckBox#overtime(class="{{#if card.getIsOvertime}}is-checked{{/if}}" name="overtime")
.materialCheckBox#overtime(class="{{#if getIsOvertime}}is-checked{{/if}}" name="overtime")
if error.get
.warning {{_ error.get}}

View file

@ -64,9 +64,6 @@ BlazeComponent.extendComponent({
showTime() {
return this.data().getSpentTime();
},
isOvertime() {
return this.data().getIsOvertime();
},
events() {
return [{
'click .js-edit-time': Popup.open('editCardSpentTime'),

View file

@ -74,8 +74,10 @@ BlazeComponent.extendComponent({
event.preventDefault();
const textarea = this.find('textarea.js-add-checklist-item');
const title = textarea.value.trim();
const cardId = this.currentData().cardId;
let cardId = this.currentData().cardId;
const card = Cards.findOne(cardId);
if (card.isImported())
cardId = card.importedId;
if (title) {
Checklists.insert({