paraviewweb icon indicating copy to clipboard operation
paraviewweb copied to clipboard

Modernize bgcolor

Open vibraphone opened this issue 9 years ago • 7 comments

vibraphone avatar Nov 01 '16 01:11 vibraphone

@vibraphone why the css contains style/classes for other components? Why d3 in that component?

model.container.querySelector('.bg-color-container').style.backgroundColor = model.color;

What was the API change that you wanted? ;-)

jourdain avatar Nov 01 '16 02:11 jourdain

@jourdain d3 is in there because I'm comfy with it. I will clean up the CSS. The API change I really wanted was what's mentioned in the commit: adopting the newInstance(publicAPI, model) API instead of just providing a constructor that takes an element and a color. I presume that part is OK?

vibraphone avatar Nov 01 '16 03:11 vibraphone

@vibraphone why the css contains style/classes for other components? Why d3 in that component?

model.container.querySelector('.bg-color-container').style.backgroundColor = model.color;

What was the API change that you wanted? ;-)

@jourdain d3 is in there because I'm comfy with it. I will clean up the CSS. The API change I really wanted was what's mentioned in the commit: adopting the newInstance(publicAPI, model) API instead of just providing a constructor that takes an element and a color. I presume that part is OK?

vibraphone avatar Nov 01 '16 03:11 vibraphone

@jourdain I've removed d3 and cleaned up the CSS.

vibraphone avatar Nov 01 '16 14:11 vibraphone

LGTM otherwise

jourdain avatar Nov 01 '16 14:11 jourdain

@jourdain @aronhelser Thanks for the feedback.

vibraphone avatar Nov 01 '16 15:11 vibraphone

Thinking about it, you should have a destroy() method that call setContainer(null) and call the "parent" destroy. You might be able to handle it by pushing a callback that does that in model.subscritions... ;-) It is kind of sneaky but that will make a more complete example. If you want we can talk about it on a hangout so I can explain what I mean.

jourdain avatar Nov 01 '16 16:11 jourdain