From c3fedeb97a455034c3c077264a89d823cab1ff01 Mon Sep 17 00:00:00 2001 From: stingl Date: Mon, 22 Nov 2021 14:11:20 +0100 Subject: [PATCH] Show open tasks; rearrange buttons; --- index.html | 10 +++++----- js/app.js | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 826cb41..2cc0256 100644 --- a/index.html +++ b/index.html @@ -78,24 +78,24 @@ Heute:
-
+
-
+
-
+
diff --git a/js/app.js b/js/app.js index f197a49..416f0e2 100644 --- a/js/app.js +++ b/js/app.js @@ -728,6 +728,21 @@ const TimeTrack = { task.done = task.percentDone == 100; this.$forceUpdate(); this.updateStorage(); + }, + getOpenTasksForTracker(tasks) { + let counter = 0; + + tasks.forEach((task) => { + if (task.open) { + counter++; + } + }); + + return counter; + }, + showOpenTasksForTracker(tasks) { + let count = this.getOpenTasksForTracker(tasks); + return count > 0 ? '('+count+' offen)' : ''; } }, beforeDestroy() {