diff --git a/perf/perf-ui.js b/perf/perf-ui.js index ca8c9c482..add0f896b 100644 --- a/perf/perf-ui.js +++ b/perf/perf-ui.js @@ -79,7 +79,10 @@ // initialize controls addListener(window, 'load', function() { function eventHandler(event) { - var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, ''); + var buildIndex = buildList.selectedIndex, + otherIndex = otherList.selectedIndex, + search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, ''); + if (event.stopPropagation) { event.stopPropagation(); } else { @@ -88,8 +91,8 @@ location.href = location.href.split('?')[0] + '?' + (search ? search + '&' : '') + - 'build=' + buildList[buildList.selectedIndex].value + '&' + - 'other=' + otherList[otherList.selectedIndex].value; + 'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' + + 'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value); } var span1 = document.createElement('span'); diff --git a/test/test-ui.js b/test/test-ui.js index 319d55852..62f7eaf2f 100644 --- a/test/test-ui.js +++ b/test/test-ui.js @@ -76,7 +76,10 @@ // initialize controls addListener(window, 'load', function() { function eventHandler(event) { - var search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, ''); + var buildIndex = buildList.selectedIndex, + loaderIndex = loaderList.selectedIndex, + search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, ''); + if (event.stopPropagation) { event.stopPropagation(); } else { @@ -85,8 +88,8 @@ location.href = location.href.split('?')[0] + '?' + (search ? search + '&' : '') + - 'build=' + buildList[buildList.selectedIndex].value + '&' + - 'loader=' + loaderList[loaderList.selectedIndex].value; + 'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' + + 'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value); } function init() {