File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff 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 ] ) ;
You can’t perform that action at this time.
0 commit comments