Skip to content

Commit 6801d50

Browse files
committed
Merge branch 'wxiaoguang-fix-toggle-elem-23042' into blender-merged
2 parents 2762bbb + 2acc2ee commit 6801d50

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

web_src/js/utils/dom.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function assertShown(el, expectShown) {
1919
}
2020

2121
function elementsCall(el, func, ...args) {
22-
if (el instanceof String) {
22+
if (typeof el === 'string' || el instanceof String) {
2323
el = document.querySelectorAll(el);
2424
}
2525
if (el instanceof Node) {
@@ -34,6 +34,10 @@ function elementsCall(el, func, ...args) {
3434
}
3535
}
3636

37+
/**
38+
* @param el string (selector), Node, NodeList, HTMLCollection, Array or jQuery
39+
* @param force force=true to show or force=false to hide, undefined to toggle
40+
*/
3741
function toggleShown(el, force) {
3842
if (force === true) {
3943
el.classList.remove('gt-hidden');

0 commit comments

Comments
 (0)