[backport]: backport applyElemsCallback
Lifted out from 19832265814430e17b456cabd207f447c003d59a. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
cbdf32126f
commit
50ac410e35
1 changed files with 9 additions and 0 deletions
|
@ -16,6 +16,15 @@ function elementsCall(el, func, ...args) {
|
|||
}
|
||||
}
|
||||
|
||||
function applyElemsCallback(elems, fn) {
|
||||
if (fn) {
|
||||
for (const el of elems) {
|
||||
fn(el);
|
||||
}
|
||||
}
|
||||
return elems;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param el string (selector), Node, NodeList, HTMLCollection, Array or jQuery
|
||||
* @param force force=true to show or force=false to hide, undefined to toggle
|
||||
|
|
Loading…
Reference in a new issue