diff --git a/resources/views/time_tracker.blade.php b/resources/views/time_tracker.blade.php index a79b68b40271..7d24768cdce6 100644 --- a/resources/views/time_tracker.blade.php +++ b/resources/views/time_tracker.blade.php @@ -94,18 +94,20 @@
- - -
- -
- +
+
   - - - +
+
+
+
+
+

@@ -182,11 +184,7 @@ self.startIcon = ko.computed(function() { if (self.selectedTask()) { - if (self.selectedTask().isRunning()) { - return 'glyphicon glyphicon-stop'; - } else { - return 'glyphicon glyphicon-play'; - } + return self.selectedTask().startIcon(); } else { return 'glyphicon glyphicon-play'; } @@ -206,11 +204,7 @@ self.startClass = ko.computed(function() { if (self.selectedTask()) { - if (self.selectedTask().isRunning()) { - return 'btn-danger'; - } else { - return 'btn-success'; - } + return self.selectedTask().startClass(); } else { return 'btn-success'; } @@ -310,6 +304,14 @@ return time.isRunning(); }); + self.startClass = ko.computed(function() { + return self.isRunning() ? 'btn-danger' : 'btn-success'; + }); + + self.startIcon = ko.computed(function() { + return self.isRunning() ? 'glyphicon glyphicon-stop' : 'glyphicon glyphicon-play'; + }); + self.age = ko.computed(function() { if (! self.time_log().length) { return '';