@@ -3,7 +3,7 @@ export default {
3
3
// Javascript to be fired on single reading view
4
4
jQuery ( $ => {
5
5
let toggle = $ ( '.block-reading-meta__compare__toggle' ) ;
6
- toggle . click ( event => {
6
+ toggle . on ( 'click' , event => {
7
7
let activity = $ ( '.block-reading-meta__compare__activity' ) ;
8
8
let alert = $ ( '.alert' ) ;
9
9
let container = $ ( '.block-reading-meta__compare__comparison' ) ;
@@ -12,9 +12,9 @@ export default {
12
12
alert . addClass ( 'visually-hidden' ) ;
13
13
if ( $ ( event . currentTarget ) . attr ( 'aria-expanded' ) === 'false' ) {
14
14
toggle . attr ( 'aria-expanded' , true ) ;
15
- activity . removeAttr ( 'hidden' ) ;
15
+ activity . prop ( 'hidden' , false ) ;
16
16
if ( container . hasClass ( 'populated' ) ) {
17
- container . removeAttr ( 'hidden' ) ;
17
+ container . prop ( 'hidden' , false ) ;
18
18
activity . attr ( 'hidden' , true ) ;
19
19
} else {
20
20
alert . text ( pressbooksBook . comparison_loading ) ;
@@ -54,7 +54,7 @@ export default {
54
54
. text ( deletions ) ;
55
55
activity . attr ( 'hidden' , true ) ;
56
56
alert . text ( pressbooksBook . comparison_loaded ) ;
57
- container . removeAttr ( 'hidden' ) ;
57
+ container . prop ( 'hidden' , false ) ;
58
58
}
59
59
} ) ;
60
60
} ) ;
@@ -78,7 +78,7 @@ export default {
78
78
const offset = 250 ;
79
79
const duration = 0 ;
80
80
81
- $ ( window ) . scroll ( function ( ) {
81
+ $ ( window ) . on ( 'scroll' , function ( ) {
82
82
if ( $ ( window ) . scrollTop ( ) > offset ) {
83
83
$ ( '.nav-reading__up' ) . animate ( { opacity : 1 } , duration ) ;
84
84
}
@@ -87,7 +87,7 @@ export default {
87
87
}
88
88
} ) ;
89
89
90
- $ ( '.nav-reading__up' ) . click ( function ( event ) {
90
+ $ ( '.nav-reading__up' ) . on ( 'click' , function ( event ) {
91
91
event . preventDefault ( ) ;
92
92
$ ( '.nav-reading__up' )
93
93
. blur ( )
@@ -96,7 +96,7 @@ export default {
96
96
return false ;
97
97
} ) ;
98
98
99
- $ ( document ) . keydown ( function ( e ) {
99
+ $ ( document ) . on ( 'keydown' , function ( e ) {
100
100
if ( $ ( 'body' ) . hasClass ( 'no-navigation' ) ) {
101
101
return ;
102
102
}
@@ -124,15 +124,15 @@ export default {
124
124
. removeAttr ( 'width' ) ;
125
125
} ) ;
126
126
127
- $ ( window ) . resize ( function ( ) {
127
+ $ ( window ) . on ( 'resize' , function ( ) {
128
128
$allVideos . each ( function ( ) {
129
129
let $el = $ ( this ) ;
130
130
let newWidth = $el . parent ( ) . parent ( ) . width ( ) ;
131
131
$el
132
132
. width ( newWidth )
133
133
. height ( newWidth * $el . data ( 'aspectRatio' ) ) ;
134
134
} ) ;
135
- } ) . resize ( ) ;
135
+ } ) . trigger ( 'resize' ) ;
136
136
} ) ( ) ;
137
137
} ) ;
138
138
} ) ;
0 commit comments