Skip to content
Permalink
Browse files

auspice: prefix serumID with "s"

The querySelector requires IDs to start with a letter. Since the
serumID is just used under the hood and does not affect the UI,
I find it easier just to inject a single letter in front of all serumIDs.
  • Loading branch information
joverlee521 committed Jan 8, 2020
1 parent 32312f1 commit b53c1bf1b5accfb687df2650002c7c51a7ec0871
Showing with 3 additions and 3 deletions.
  1. +3 −3 auspice/js/auspice/colors.js
@@ -448,18 +448,18 @@ function newFocus(){

for (var i=0; i<allSera.length; i++){
var serum = allSera[i];
var serumID = serum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
var serumID = "s" + serum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
htmlStr+='<input type="checkbox" id="' + serumID + '" name="' + serum + '" checked="checked"> ' + serum +"<br>";
activeSera[serum]=true;
}
seraDiv.innerHTML = htmlStr;
for (var serum in titer_subs_model["potency"][focusNode.strain]){
var serumID = serum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
var serumID = "s" + serum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
d3.select("#"+serumID)
.on("change", function(elem){
for (var j=0; j<allSera.length; j++){
var tmpserum = allSera[j];
var tmpserumID = tmpserum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
var tmpserumID = "s" + tmpserum.split("/").join("").replace(/[;,\*\.\(\)]/g, "_");
activeSera[tmpserum]=document.getElementById(tmpserumID).checked;
}
colorByHIDistance()});

0 comments on commit b53c1bf

Please sign in to comment.
You can’t perform that action at this time.