1
1
$ ( function ( ) {
2
- $ ( '#backButton' ) . on ( 'click' , function ( ) {
2
+ $ ( '#backButton' ) . on ( 'click' , ( ) => {
3
3
document . location . href = 'chart.html' ;
4
4
} ) ;
5
5
@@ -21,7 +21,7 @@ $(function () {
21
21
$ ( '#days-edit-input' ) . val ( obj . conf [ kind ] . days ) ;
22
22
}
23
23
24
- $ ( '#edit-form' ) . on ( 'submit' , function ( e ) {
24
+ $ ( '#edit-form' ) . on ( 'submit' , e => {
25
25
e . preventDefault ( ) ;
26
26
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 ) ) ;
27
27
console . log ( 'New duration parsed' , newDuration , editingKind , editingVar . dayStr ) ;
@@ -44,9 +44,7 @@ $(function () {
44
44
} ) ;
45
45
} ) ;
46
46
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 => {
50
48
return {
51
49
day : YTTGetDateFromDay ( day ) ,
52
50
dayStr : day ,
@@ -64,7 +62,7 @@ $(function () {
64
62
if ( obj . conf . getOpenedDuration ( ) . getAsMilliseconds ( ) > WEIRD_DATA_THRESHOLD ) {
65
63
let buttonEditOpened = $ ( `<button type="button" class="btn btn-primary btn-block edit-conf-value" data-toggle="modal" data-target="#modal-time">` )
66
64
. 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 => {
68
66
startEdit ( $ ( this ) , obj , YTT_DATA_OPENED ) ;
69
67
} ) ;
70
68
$ ( '<div class="row mt-1">' ) . append ( buttonEditOpened ) . appendTo ( editDiv ) ;
0 commit comments