Allow /test and /perf to change dropdown values if the other dropdown has a custom entry.

Former-commit-id: d56880e7c588b14ae4c65cacc37f042352e5eee1
This commit is contained in:
John-David Dalton
2013-07-16 23:48:29 -07:00
parent a17c32bed0
commit d842a2f62e
2 changed files with 12 additions and 6 deletions

View File

@@ -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');

View File

@@ -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() {