Skip to content

Commit adbcf63

Browse files
author
Harm Akkerman
committed
Fixed issue 194
1 parent 5d436f0 commit adbcf63

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

js/src/timer.js

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,13 @@ function() {
382382
})
383383
$('.wi-play').click(function(e) {
384384
e.preventDefault();
385-
$('#work-input').val($(this).data('work-name'));
386-
startTimer($(this).data('projectid'), $(this).data('tagids'));
387-
return false;
388-
})
385+
createWorkItem($(this));
386+
});
387+
388+
$('.wi-resume').click(function(e) {
389+
e.preventDefault();
390+
resumeWorkItem($(this));
391+
});
389392
$('.wi-trash').click(function(e) {
390393
$("#dialog-confirm").dialog({
391394
buttons : {
@@ -577,6 +580,20 @@ function() {
577580
});
578581
}
579582

583+
function createWorkItem(wiPlay) {
584+
var workName = $('#work-input').val();
585+
$('#work-input').val(wiPlay.data('work-name'));
586+
startTimer(wiPlay.data('projectid'), wiPlay.data('tagids'), workName);
587+
return false;
588+
}
589+
590+
function resumeWorkItem(wiResume) {
591+
console.log('Resuming');
592+
console.log(wiResume);
593+
startTimer(wiResume.data('projectid'), wiResume.data('tagids'), wiResume.data('work-name'));
594+
return false;
595+
}
596+
580597
function startTimer(projectId = null, tags = ""){
581598
if(localStorage.getItem('isTimerStarted') === 'true'){
582599
stopTimer(startTimer, [projectId, tags]);

0 commit comments

Comments
 (0)