From 3c6915e217de2c9c572b3716a398b77da1693e24 Mon Sep 17 00:00:00 2001 From: Ben0it-T Date: Fri, 15 Oct 2021 21:40:20 +0200 Subject: [PATCH] Fix : Setting overtime not working #1893 --- client/components/cards/cardTime.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/components/cards/cardTime.js b/client/components/cards/cardTime.js index d8a41aaa0..20adbccfd 100644 --- a/client/components/cards/cardTime.js +++ b/client/components/cards/cardTime.js @@ -9,7 +9,6 @@ BlazeComponent.extendComponent({ toggleOvertime() { this.card.setIsOvertime(!this.card.getIsOvertime()); $('#overtime .materialCheckBox').toggleClass('is-checked'); - $('#overtime').toggleClass('is-checked'); }, storeTime(spentTime, isOvertime) { @@ -18,6 +17,7 @@ BlazeComponent.extendComponent({ }, deleteTime() { this.card.setSpentTime(null); + this.card.setIsOvertime(false); }, events() { return [ @@ -27,8 +27,11 @@ BlazeComponent.extendComponent({ evt.preventDefault(); const spentTime = parseFloat(evt.target.time.value); - const isOvertime = this.card.getIsOvertime(); - + //const isOvertime = this.card.getIsOvertime(); + let isOvertime = false; + if ($('#overtime').attr('class').indexOf('is-checked') >= 0) { + isOvertime = true; + } if (spentTime >= 0) { this.storeTime(spentTime, isOvertime); Popup.close();