File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 7
7
for more details.
8
8
- The ` data-hd-src ` attribute was changed to use a Stimulus value called ` src ` . See the
9
9
updated README for usage.
10
+ - For both JavaScript events - ` lazy-image:connect ` and ` lazy-image:ready ` -
11
+ the ` event.detail.hd ` ` Image ` instance was moved to ` event.detail.image ` .
10
12
- Support added for Symfony 6
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ class default_1 extends Controller {
9
9
if ( srcsetString ) {
10
10
this . element . srcset = srcsetString ;
11
11
}
12
- this . _dispatchEvent ( 'lazy-image:ready' , { hd } ) ;
12
+ this . _dispatchEvent ( 'lazy-image:ready' , { image : hd } ) ;
13
13
} ) ;
14
14
hd . src = this . srcValue ;
15
15
if ( srcsetString ) {
16
16
hd . srcset = srcsetString ;
17
17
}
18
- this . _dispatchEvent ( 'lazy-image:connect' , { hd } ) ;
18
+ this . _dispatchEvent ( 'lazy-image:connect' , { image : hd } ) ;
19
19
}
20
20
_calculateSrcsetString ( ) {
21
21
if ( ! this . hasSrcsetValue ) {
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ export default class extends Controller {
27
27
if ( srcsetString ) {
28
28
this . element . srcset = srcsetString ;
29
29
}
30
- this . _dispatchEvent ( 'lazy-image:ready' , { hd } ) ;
30
+ this . _dispatchEvent ( 'lazy-image:ready' , { image : hd } ) ;
31
31
} ) ;
32
32
33
33
hd . src = this . srcValue ;
34
34
if ( srcsetString ) {
35
35
hd . srcset = srcsetString ;
36
36
}
37
37
38
- this . _dispatchEvent ( 'lazy-image:connect' , { hd } ) ;
38
+ this . _dispatchEvent ( 'lazy-image:connect' , { image : hd } ) ;
39
39
}
40
40
41
41
_calculateSrcsetString ( ) : string {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class CheckController extends Controller {
20
20
this . element . addEventListener ( 'lazy-image:connect' , ( event ) => {
21
21
// the Image won't natively have its "load" method in this test
22
22
// so we trigger it manually, to "fake" the Image loading.
23
- event . detail . hd . dispatchEvent ( new Event ( 'load' ) ) ;
23
+ event . detail . image . dispatchEvent ( new Event ( 'load' ) ) ;
24
24
this . element . classList . add ( 'connected' ) ;
25
25
} ) ;
26
26
}
You can’t perform that action at this time.
0 commit comments