Commit 71b487eb authored by Andrew Cohen's avatar Andrew Cohen

cellfeatures color change

parent ac9a44c4
......@@ -1041,6 +1041,30 @@ function cxGetCellFeatures(cx)
return cxFeatures;
}
// user changed a feature color
function changeFeatureColor(i)
{
// first, change it locally in constants
var colorInput=document.getElementById('featureColor_'+i);
// note -- because cellFeatures is used by matlab, we allow it to be either a single
// element struct, or a list
if (undefined===CONSTANTS.cellFeatures.length) {
if (i!==0) {
console.warn('CONSTANTS: singleton cellFeatures with non-0 list index! ACK')
}
CONSTANTS.cellFeatures.color=colorInput.value;
}
else
CONSTANTS.cellFeatures[i].color=colorInput.value;
// redraw
toggleShowLineage();
// should we write it back into CONSTANTS?
// lets do that
writeViewConstantsToDB(); // see view.js
} // changeFeatureColor
function lineageShowFeatures(cx)
{
if (undefined==cx)
......@@ -1064,7 +1088,7 @@ function lineageShowFeatures(cx)
var color=standardize_color(cxFeatures[i].color);
// feature is index,color,show,delete
newFeature.innerHTML=cxFeatures[i].name+' <input type="color" value="'+color+
'" id="featureColor_'+i+'"/> show <input type="checkbox" '+
'" id="featureColor_'+i+'" onChange="changeFeatureColor('+i+')" /> show <input type="checkbox" '+
' onclick="toggleShowFeature('+i+')" id=featureShow_'+i+' />';
divFeatures.appendChild(newFeature);
document.getElementById('featureShow_'+i).checked=cxFeatures[i].bShow;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment