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 77 for more details.
88- The ` data-hd-src ` attribute was changed to use a Stimulus value called ` src ` . See the
99 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 ` .
1012- Support added for Symfony 6
Original file line number Diff line number Diff line change @@ -9,13 +9,13 @@ class default_1 extends Controller {
99 if ( srcsetString ) {
1010 this . element . srcset = srcsetString ;
1111 }
12- this . _dispatchEvent ( 'lazy-image:ready' , { hd } ) ;
12+ this . _dispatchEvent ( 'lazy-image:ready' , { image : hd } ) ;
1313 } ) ;
1414 hd . src = this . srcValue ;
1515 if ( srcsetString ) {
1616 hd . srcset = srcsetString ;
1717 }
18- this . _dispatchEvent ( 'lazy-image:connect' , { hd } ) ;
18+ this . _dispatchEvent ( 'lazy-image:connect' , { image : hd } ) ;
1919 }
2020 _calculateSrcsetString ( ) {
2121 if ( ! this . hasSrcsetValue ) {
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ export default class extends Controller {
2727 if ( srcsetString ) {
2828 this . element . srcset = srcsetString ;
2929 }
30- this . _dispatchEvent ( 'lazy-image:ready' , { hd } ) ;
30+ this . _dispatchEvent ( 'lazy-image:ready' , { image : hd } ) ;
3131 } ) ;
3232
3333 hd . src = this . srcValue ;
3434 if ( srcsetString ) {
3535 hd . srcset = srcsetString ;
3636 }
3737
38- this . _dispatchEvent ( 'lazy-image:connect' , { hd } ) ;
38+ this . _dispatchEvent ( 'lazy-image:connect' , { image : hd } ) ;
3939 }
4040
4141 _calculateSrcsetString ( ) : string {
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class CheckController extends Controller {
2020 this . element . addEventListener ( 'lazy-image:connect' , ( event ) => {
2121 // the Image won't natively have its "load" method in this test
2222 // 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' ) ) ;
2424 this . element . classList . add ( 'connected' ) ;
2525 } ) ;
2626 }
You can’t perform that action at this time.
0 commit comments