1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Working on the time tracker

This commit is contained in:
Hillel Coren 2017-10-02 10:33:02 +03:00
parent 68bbd9b14e
commit 33ea69474c

View File

@ -1107,7 +1107,25 @@
};
self.actionButtonVisible = ko.computed(function() {
return self.isHovered() && ! self.isEmpty();
if (! model.selectedTask()) {
return false;
}
if (! self.isHovered()) {
return false;
}
var times = model.selectedTask().time_log();
var count = 0;
for (var i=0; i<times.length; i++) {
var timeLog = times[i];
if (timeLog.isEmpty()) {
count++;
}
}
if (count > 1) {
return true;
}
return ! self.isEmpty() && times.length > 1;
});
self.onMouseOver = function() {