mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:14:14 +00:00
[backport]: backport applyElemsCallback
Lifted out from 1983226581
.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
cbdf32126f
commit
50ac410e35
|
@ -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