Skip to content

Commit 14af661

Browse files
committed
maint(pat inject): Use dom.find_scroll_container instead jQuery :scrollable selector.
1 parent ae01e20 commit 14af661

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/pat/inject/inject.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "../../core/jquery-ext"; // for :scrollable for autoLoading-visible
1+
import "../../core/jquery-ext"; // for findInclusive
22
import $ from "jquery";
33
import ajax from "../ajax/ajax";
44
import dom from "../../core/dom";
@@ -487,8 +487,11 @@ const inject = {
487487
}
488488

489489
if (cfg.scroll && cfg.scroll !== "none") {
490-
let scroll_container = cfg.$target.parents().addBack().filter(":scrollable");
491-
scroll_container = scroll_container.length ? scroll_container[0] : window;
490+
const scroll_container = dom.find_scroll_container(
491+
cfg.$target[0],
492+
null,
493+
window
494+
);
492495

493496
// default for scroll===top
494497
let top = 0;

0 commit comments

Comments
 (0)