works, basically

This commit is contained in:
Jens Kraemer
2020-04-24 17:20:18 +08:00
parent 70257cdee0
commit 20ccbba2c1
24 changed files with 355 additions and 27 deletions

View File

@@ -0,0 +1,24 @@
window.Stopwatch = {
highlightRunningTimer: function(){
$.get(Stopwatch.currentTimerUrl, function(data){
if (data.running && data.time_entry_id) {
Stopwatch.highlightTimer(data.time_entry_id);
}
});
},
highlightTimer: function(id){
$('table.time-entries tr.time-entry.running').removeClass('running');
if(id && id != ''){
$('table.time-entries tr.time-entry').each(function(idx, el){
var tr = $(el);
var trId = tr.attr('id');
if (trId && trId == 'time-entry-'+id) {
tr.addClass('running');
}
});
}
}
};
$(document).on('ready', Stopwatch.highlightRunningTimer);

View File

@@ -0,0 +1,3 @@
tr.time-entry.running td.hours {
color: red;
}