If a machine isn't in the server-defined list, add it to the select box to allow reload with other parameters.
authorMark Cote <mcote@mozilla.com>
Tue, 04 Oct 2011 19:23:21 -0400
changeset 77 b96cffc25e39020dacdc3926cd96c771697caef1
parent 76 6868be4eb9a99472572dc58dca10d68243796653
child 78 f619342b2fc24b5dd00a81a0317ab4ffbae679f9
push id75
push usermcote@mozilla.com
push dateTue, 04 Oct 2011 23:23:19 +0000
If a machine isn't in the server-defined list, add it to the select box to allow reload with other parameters.
html/js/speedtest_results.js
--- a/html/js/speedtest_results.js
+++ b/html/js/speedtest_results.js
@@ -268,17 +268,21 @@ function routerFactory() {
 function loadFromRoute(testname, machine, start, end) {
   if (!testname) {
     testname = $($('#testselect option')[0]).val();
   }
   $('#testselect').selectOptions(testname);
   if (!machine) {
     machine = $($('#machineselect option')[0]).val();
   }
-  $('#machineselect').selectOptions(machine);
+  if ($('#machineselect').containsOption(machine)) {
+    $('#machineselect').selectOptions(machine);
+  } else {
+    $('#machineselect').addOption(machine, machine, true);
+  }
   var startDate, endDate;
   if (end) {
     endDate = new Date(end);
   } else {
     endDate = new Date();
     end = ISODateString(endDate);
   }
   if (start) {