File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,14 @@ var plotArea = document.getElementById('plots');
175175
176176searchBar . addEventListener ( 'keyup' , debounce ( searchMocks , 250 ) ) ;
177177
178+ window . onload = function ( ) {
179+ var initialMock = window . location . hash . replace ( / ^ # / , '' ) ;
180+
181+ if ( initialMock . length > 0 ) {
182+ Tabs . plotMock ( initialMock ) ;
183+ }
184+ } ;
185+
178186function debounce ( func , wait , immediate ) {
179187 var timeout ;
180188 return function ( ) {
@@ -206,10 +214,12 @@ function searchMocks(e) {
206214 result . innerText = r . name ;
207215
208216 result . addEventListener ( 'click' , function ( ) {
217+ var mockName = r . file . slice ( 0 , - 5 ) ;
218+ window . location . hash = mockName ;
209219
210220 // Clear plots and plot selected.
211221 Tabs . purge ( ) ;
212- Tabs . plotMock ( r . file . slice ( 0 , - 5 ) ) ;
222+ Tabs . plotMock ( mockName ) ;
213223 } ) ;
214224
215225 mocksList . appendChild ( result ) ;
You can’t perform that action at this time.
0 commit comments