mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 23:05:39 +03: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
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