Fix: collect() now accepts both CSS selector strings and NodeLists
This commit is contained in:
+2
-1
@@ -125,7 +125,8 @@ const Resume = (() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function collect(sel, fn) {
|
function collect(sel, fn) {
|
||||||
return Array.from(document.querySelectorAll(sel)).map(el => fn ? fn(el) : (el.innerHTML || ''));
|
const els = (typeof sel === 'string') ? document.querySelectorAll(sel) : sel;
|
||||||
|
return Array.from(els).map(el => fn ? fn(el) : (el.innerHTML || ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
function collectCards(listId) {
|
function collectCards(listId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user