diff --git a/devtools/test_dashboard/devtools.js b/devtools/test_dashboard/devtools.js index ea5b7b71636..3968379c5a1 100644 --- a/devtools/test_dashboard/devtools.js +++ b/devtools/test_dashboard/devtools.js @@ -175,6 +175,14 @@ var plotArea = document.getElementById('plots'); searchBar.addEventListener('keyup', debounce(searchMocks, 250)); +window.onload = function() { + var initialMock = window.location.hash.replace(/^#/, ''); + + if(initialMock.length > 0) { + Tabs.plotMock(initialMock); + } +}; + function debounce(func, wait, immediate) { var timeout; return function() { @@ -206,10 +214,12 @@ function searchMocks(e) { result.innerText = r.name; result.addEventListener('click', function() { + var mockName = r.file.slice(0, -5); + window.location.hash = mockName; // Clear plots and plot selected. Tabs.purge(); - Tabs.plotMock(r.file.slice(0, -5)); + Tabs.plotMock(mockName); }); mocksList.appendChild(result);