Fix : Setting overtime not working #1893

This commit is contained in:
Ben0it-T 2021-10-15 21:40:20 +02:00
parent 629fa91fa0
commit 3c6915e217

View file

@ -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();