Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed issue 194
  • Loading branch information
Harm Akkerman committed Nov 8, 2022
commit adbcf6384edf8d6093bf72cee3ebed158c44d699
25 changes: 21 additions & 4 deletions js/src/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,13 @@ function() {
})
$('.wi-play').click(function(e) {
e.preventDefault();
$('#work-input').val($(this).data('work-name'));
startTimer($(this).data('projectid'), $(this).data('tagids'));
return false;
})
createWorkItem($(this));
});

$('.wi-resume').click(function(e) {
e.preventDefault();
resumeWorkItem($(this));
});
$('.wi-trash').click(function(e) {
$("#dialog-confirm").dialog({
buttons : {
Expand Down Expand Up @@ -577,6 +580,20 @@ function() {
});
}

function createWorkItem(wiPlay) {
var workName = $('#work-input').val();
$('#work-input').val(wiPlay.data('work-name'));
startTimer(wiPlay.data('projectid'), wiPlay.data('tagids'), workName);
return false;
}

function resumeWorkItem(wiResume) {
console.log('Resuming');
console.log(wiResume);
startTimer(wiResume.data('projectid'), wiResume.data('tagids'), wiResume.data('work-name'));
return false;
}

function startTimer(projectId = null, tags = ""){
if(localStorage.getItem('isTimerStarted') === 'true'){
stopTimer(startTimer, [projectId, tags]);
Expand Down