Skip to content

Commit b996154

Browse files
committed
maint(pat inject): Modernize code.
1 parent c9d94a4 commit b996154

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/pat/inject/inject.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,6 @@ const inject = {
960960
return $html;
961961
},
962962

963-
// XXX: hack
964963
_initAutoloadVisible($el, cfgs) {
965964
if ($el.data("pat-inject-autoloaded")) {
966965
// ignore executed autoloads
@@ -980,7 +979,7 @@ const inject = {
980979
};
981980
$el.click(trigger);
982981

983-
// Use case 1: a (heigh-constrained) scrollable parent
982+
// Use case 1: a (height-constrained) scrollable parent
984983
if ($scrollable.length) {
985984
// if scrollable parent and visible -> trigger it
986985
// we only look at the closest scrollable parent, no nesting
@@ -999,9 +998,8 @@ const inject = {
999998
if (target && target !== "self" && $(target).length === 0) {
1000999
return false;
10011000
}
1002-
const reltop =
1003-
$el.safeOffset().top - $scrollable.safeOffset().top - 1000,
1004-
doTrigger = reltop <= $scrollable.innerHeight();
1001+
const reltop = $el.safeOffset().top - $scrollable.safeOffset().top - 1000; // prettier-ignore
1002+
const doTrigger = reltop <= $scrollable.innerHeight();
10051003
if (doTrigger) {
10061004
// checkVisibility was possibly installed as a scroll
10071005
// handler and has now served its purpose -> remove

0 commit comments

Comments
 (0)