Pārlūkot izejas kodu

When no iteration specified, take the first (#0), not the last.

Jaskar 8 gadi atpakaļ
vecāks
revīzija
9611ef830c
2 mainītis faili ar 4 papildinājumiem un 1 dzēšanām
  1. 1 0
      Playground/frame.js
  2. 3 1
      Playground/index.js

+ 1 - 0
Playground/frame.js

@@ -150,6 +150,7 @@
 
                 var hash = location.hash.substr(1);
                 currentSnippetToken = hash.split("#")[0];
+                if(!hash.split("#")[1]) hash += "#0";
 
                 xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
                 xmlHttp.send();

+ 3 - 1
Playground/index.js

@@ -678,10 +678,12 @@
                                     }
                                 }
                             }
-                        }
+                        };
 
                         var hash = location.hash.substr(1);
                         currentSnippetToken = hash.split("#")[0];
+                        if(!hash.split("#")[1]) hash += "#0";
+
 
                         xmlHttp.open("GET", snippetUrl + "/" + hash.replace("#", "/"));
                         xmlHttp.send();