Ivan Asmer 8 年 前
コミット
f621541380
1 ファイル変更1 行追加4 行削除
  1. 1 4
      static/nb.js

+ 1 - 4
static/nb.js

@@ -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]);