Quellcode durchsuchen

closure fake selector

Ivan Asmer vor 7 Jahren
Ursprung
Commit
ff636896c9
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      static/nb.js

+ 2 - 2
static/nb.js

@@ -20,11 +20,11 @@ function nbInit(a,b){
     var closure = null;
     var closure = null;
 
 
     function searchElement(root, selector){
     function searchElement(root, selector){
-        if (selector.indexOf('|dom') === selector.length - 4){
+        if ((selector.indexOf('|dom') === selector.length - 4) && (selector.length > 4)){
             selector = selector.slice(0,selector.length - 4)
             selector = selector.slice(0,selector.length - 4)
             dom      = true;
             dom      = true;
         }
         }
-        if (selector.indexOf('|closure') === selector.length - 8){
+        if ((selector.indexOf('|closure') === selector.length - 8) && (selector.length > 8)){
             selector = selector.slice(0,selector.length - 8)
             selector = selector.slice(0,selector.length - 8)
             closure  = true;
             closure  = true;
         }
         }