11$ ( function ( ) {
2- $ ( '#backButton' ) . on ( 'click' , function ( ) {
2+ $ ( '#backButton' ) . on ( 'click' , ( ) => {
33 document . location . href = 'chart.html' ;
44 } ) ;
55
@@ -21,7 +21,7 @@ $(function () {
2121 $ ( '#days-edit-input' ) . val ( obj . conf [ kind ] . days ) ;
2222 }
2323
24- $ ( '#edit-form' ) . on ( 'submit' , function ( e ) {
24+ $ ( '#edit-form' ) . on ( 'submit' , e => {
2525 e . preventDefault ( ) ;
2626 const newDuration = new YTTDuration ( editingKind , 0 , parseInt ( $ ( '#seconds-edit-input' ) . val ( ) || '0' , 10 ) , parseInt ( $ ( '#minutes-edit-input' ) . val ( ) || '0' , 10 ) , parseInt ( $ ( '#hours-edit-input' ) . val ( ) || '0' , 10 ) , parseInt ( $ ( '#days-edit-input' ) . val ( ) || '0' , 10 ) ) ;
2727 console . log ( 'New duration parsed' , newDuration , editingKind , editingVar . dayStr ) ;
@@ -44,9 +44,7 @@ $(function () {
4444 } ) ;
4545 } ) ;
4646
47- Object . keys ( config ) . filter ( k => k . startsWith ( 'day' ) ) . map ( k => k . replace ( 'day' , '' ) ) . sort ( function ( a , b ) {
48- return YTTCompareConfigDate ( b , a ) ;
49- } ) . map ( day => {
47+ Object . keys ( config ) . filter ( k => k . startsWith ( 'day' ) ) . map ( k => k . replace ( 'day' , '' ) ) . sort ( ( a , b ) => YTTCompareConfigDate ( b , a ) ) . map ( day => {
5048 return {
5149 day : YTTGetDateFromDay ( day ) ,
5250 dayStr : day ,
@@ -64,7 +62,7 @@ $(function () {
6462 if ( obj . conf . getOpenedDuration ( ) . getAsMilliseconds ( ) > WEIRD_DATA_THRESHOLD ) {
6563 let buttonEditOpened = $ ( `<button type="button" class="btn btn-primary btn-block edit-conf-value" data-toggle="modal" data-target="#modal-time">` )
6664 . text ( `Edit opened time of the ${ YTTGetDateString ( obj . day . getTime ( ) ) } (${ obj . conf . getOpenedDuration ( ) . getAsString ( ) } )` ) ;
67- buttonEditOpened . on ( 'click' , function ( e ) {
65+ buttonEditOpened . on ( 'click' , e => {
6866 startEdit ( $ ( this ) , obj , YTT_DATA_OPENED ) ;
6967 } ) ;
7068 $ ( '<div class="row mt-1">' ) . append ( buttonEditOpened ) . appendTo ( editDiv ) ;
0 commit comments