+
+
@@ -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 '';