mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
ported to static site, removed _ext folder, split hbs files into partials
This commit is contained in:
13
js/util/onClickChildren.js
Normal file
13
js/util/onClickChildren.js
Normal file
@@ -0,0 +1,13 @@
|
||||
//add click listener to each of specified element's children
|
||||
|
||||
function onClickChildren(parentElement, functionCallback) {
|
||||
|
||||
var parentElement = (typeof parentElement == 'string' ? document.getElementById(parentElement) : parentElement);
|
||||
|
||||
var children = parentElement.children;
|
||||
|
||||
//loop through children and add onClick listener
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
onClick(children[i],functionCallback);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user