Ivan Asmer 8 anni fa
parent
commit
23b355ca78
1 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 6 1
      static/nb.js

+ 6 - 1
static/nb.js

@@ -17,7 +17,12 @@ function nbInit(a,b){
     var root=document, $s=a;
 
     function searchElement(root, selector){
-        var items = [root.getElementById(selector)]; 
+        if (root === document){
+            var items = [root.getElementById(selector)]; 
+        }
+        else {
+            items = root.querySelectorAll("#" + selector); 
+        }
         items     = items[0]     ? items :  root.querySelectorAll(selector);
         items     = items.length ? items :  root.getElementsByName(selector); 
         items     = items.length ? items :  root.getElementsByClassName(selector);