|
@@ -45,10 +45,7 @@ function nbInit(a,b){
|
|
|
var result = [];
|
|
|
selector = prop || selector; //change selector to passed if it
|
|
|
|
|
|
- var items = [document.getElementById(selector)];
|
|
|
- items = items[0] ? items : document.querySelectorAll(selector);
|
|
|
- items = items.length ? items : document.getElementsByName(selector);
|
|
|
- items = items.length ? items : document.getElementsByClassName(selector);
|
|
|
+ var items = searchElement(root, selector);
|
|
|
for (var i=0,item=items[i];i<items.length;i++,item=items[i]){
|
|
|
if (direction == "write" && Array.isArray($s[selector]) && (item.children.length == 0 || (items.length == $s[selector].length))){
|
|
|
callback(item, $s, selector, $s[selector][i]);
|