File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1- import "../../core/jquery-ext" ; // for findInclusive
21import "../../core/polyfills" ; // SubmitEvent.submitter for Safari < 15.4 and jsDOM
32import $ from "jquery" ;
43import ajax from "../ajax/ajax" ;
@@ -461,9 +460,11 @@ const inject = {
461460 }
462461 let $src ;
463462 $src = $source . safeClone ( ) ;
464- $src . findInclusive ( "img" ) . on ( "load" , ( e ) => {
465- $ ( e . currentTarget ) . trigger ( "pat-inject-content-loaded" ) ;
466- } ) ;
463+ for ( const img of dom . querySelectorAllAndMe ( $src [ 0 ] , "img" ) ) {
464+ $ ( img ) . on ( "load" , ( e ) => {
465+ $ ( e . currentTarget ) . trigger ( "pat-inject-content-loaded" ) ;
466+ } ) ;
467+ }
467468
468469 const $injected = cfg . $injected || $src ;
469470 // Now the injection actually happens.
@@ -529,7 +530,7 @@ const inject = {
529530 // 2) getting the element to scroll to (if not "top")
530531 const scroll_target = [ "top" , "target" ] . includes ( cfg . scroll )
531532 ? cfg . $target [ 0 ]
532- : $injected . findInclusive ( cfg . scroll ) [ 0 ] ;
533+ : dom . querySelectorAllAndMe ( $injected [ 0 ] , cfg . scroll ) ;
533534
534535 const scroll_container = dom . find_scroll_container (
535536 scroll_target ,
You can’t perform that action at this time.
0 commit comments