Dashboard widgets, msg.className should append to not replace widget's Class

Dashboard widgets eg switches can defined as Class "STEAM" in the editor.
Now groups of widgets can be styled alike across dashboard tabs and groups
The CSS path is

... md-card.nr-dashboard-switch.[blah].STEAM.visible

If you pass msg.className "GREEN" to a widget it's CSS path becomes

... md-card.nr-dashboard-switch [blah].GREEN.visible

(GREEN replaces STEAM)
Would it be better to append msg.className? Giving

... md-card.nr-dashboard-switch[blah].STEAM.GREEN.visible

Now all the STEAM widgets can retain STEAM styling (background colour?) and also show GREEN (border green?)

With this modification a null msg.className would have to remove .GREEN but retain .STEAM

I think this would be hard to manage, given there could be none to many classes on the widget ?

I haven't tried but can you send steam and green together to do what you want, ie have 2 classes ?

I have sent more than one class in msg.className.
I think it was a simple list "myclass alert".

At the moment you can give groups a class in the editor but once you use msg.className they lose that. No doubt it's simpler to code but less flexible for the user.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.