Hi,
I have an adornment that I add to a node dynamically.
On mouse enter I show the adornment and on mouse leave I hide it.
Depending on the data of the node I want to change the look of the adornment.
Notice I have icons with a gray background and some with white background.
Since the data is changed outside the model of the node I am evaluating the node’s data on mouse enter and mouse leave events and changing the background as needed.
This is the code:
let toggleActionIcons = function(shouldShow){
actionIconsNames.forEach(function(v){
for(let adIt = obj.adornments; adIt.next();){
let icon = adIt.value.findObject(v);
let shape = adIt.value.findObject('AdorShape');
if (shape) {
shape.fill = obj.data[v] ? '#747474' : '#ffffff';
}
if(icon){
if(obj.data[v]){
icon.visible = true;
}else{
icon.visible = shouldShow;
}
}
}
});
};
My problem is that changing to visible property of the icons works perfectly but changing the fill property does not work at all.
What am I doing wrong here ?
Thanks,
Oren