aboutsummaryrefslogtreecommitdiff
path: root/assets_src/js/lib
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-11-14 15:55:50 (UTC)
committerjan <jan@ruken.pw>2016-11-14 15:55:50 (UTC)
commitc735553214400f3af69e516ff41a6da9214449a7 (patch)
treec9a8e8fc84fdbaffb3a3fa318453b36270550ebb /assets_src/js/lib
parent9832cd28de49421021ed7c1f3caa7fdda7bc4372 (diff)
likes und so.
Diffstat (limited to 'assets_src/js/lib')
-rw-r--r--assets_src/js/lib/dom.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/assets_src/js/lib/dom.js b/assets_src/js/lib/dom.js
index bfbeea7..3c2f4d9 100644
--- a/assets_src/js/lib/dom.js
+++ b/assets_src/js/lib/dom.js
@@ -17,6 +17,16 @@ export function closest(el, fn) {
17 return null; 17 return null;
18} 18}
19 19
20export function withClass(className) {
21 const els = document.getElementsByClassName(className);
22 const arr = [];
23
24 for (let i = 0; i < els.length; i++) {
25 arr.push(els.item(i));
26 }
27 return arr;
28}
29
20export function next(el, fn) { 30export function next(el, fn) {
21 if (!el) { 31 if (!el) {
22 return null; 32 return null;