File tree 1 file changed +11
-1
lines changed
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');
175
175
176
176
searchBar . addEventListener ( 'keyup' , debounce ( searchMocks , 250 ) ) ;
177
177
178
+ window . onload = function ( ) {
179
+ var initialMock = window . location . hash . replace ( / ^ # / , '' ) ;
180
+
181
+ if ( initialMock . length > 0 ) {
182
+ Tabs . plotMock ( initialMock ) ;
183
+ }
184
+ } ;
185
+
178
186
function debounce ( func , wait , immediate ) {
179
187
var timeout ;
180
188
return function ( ) {
@@ -206,10 +214,12 @@ function searchMocks(e) {
206
214
result . innerText = r . name ;
207
215
208
216
result . addEventListener ( 'click' , function ( ) {
217
+ var mockName = r . file . slice ( 0 , - 5 ) ;
218
+ window . location . hash = mockName ;
209
219
210
220
// Clear plots and plot selected.
211
221
Tabs . purge ( ) ;
212
- Tabs . plotMock ( r . file . slice ( 0 , - 5 ) ) ;
222
+ Tabs . plotMock ( mockName ) ;
213
223
} ) ;
214
224
215
225
mocksList . appendChild ( result ) ;
You can’t perform that action at this time.
0 commit comments