Hi Max,
Thanks for your quick answer.
I checked the content of cssToKeep and it was corresponding to the displayed css.
I finally found a way to go around this issue. I try to explain in the following code which works with cytoscape.js live example:
window.cy = this;
var j = cy.$('#j');
j.css("color","black"); //modify the css of the node
var cssOld=j.css();// get the css of the node to be applied to it when we put it back
var k= cy.$('#k');
k.css(cssOld);
cy.remove(j);
cy.add(j);
j.css(cssOld);// apply the saved css
With the above code the node j is not black.
window.cy = this;
var j = cy.$('#j');
j.css("color","black");
var cssOld=j.css();
var k= cy.$('#k');
k.css(cssOld);
cy.remove(j);
cy.add(j);
var j = cy.$('#j'); j.css(cssOld);
Getting again the node and applying the modfied css works.
Maybe it is a javascript issue (I am new to it).
I hope it may help.
Cheers and thanks for developing Cytoscape.js
Fabien