Skip to content

Commit 6ba1501

Browse files
committed
maint(core utils): hideOrShow - filter for dom elements.
Use dom.to_element_array instead of dom.toNodeArray to filter for DOM elements instead of nodes.
1 parent 820f536 commit 6ba1501

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ function hasValue(el) {
242242
return false;
243243
}
244244

245-
const hideOrShow = (nodes, visible, options, pattern_name) => {
246-
nodes = dom.toNodeArray(nodes);
245+
const hideOrShow = (elements, visible, options, pattern_name) => {
246+
elements = dom.to_element_array(elements);
247247

248248
const transitions = {
249249
none: { hide: "hide", show: "show" },
@@ -267,7 +267,7 @@ const hideOrShow = (nodes, visible, options, pattern_name) => {
267267
});
268268
};
269269

270-
for (const el of nodes) {
270+
for (const el of elements) {
271271
el.classList.remove("visible");
272272
el.classList.remove("hidden");
273273
el.classList.remove("in-progress");
@@ -415,7 +415,7 @@ function isElementInViewport(el, partial = false, offset = 0) {
415415
rec.top >= 0 &&
416416
rec.left >= 0 &&
417417
rec.bottom <=
418-
(window.innerHeight || document.documentElement.clientHeight) &&
418+
(window.innerHeight || document.documentElement.clientHeight) &&
419419
rec.right <= (window.innerWidth || document.documentElement.clientWidth)
420420
);
421421
}

0 commit comments

Comments
 (0)