Assign CSS class to editor dialog
Assign CSS class to editor dialog
This question is along the same lines as Assign an CSS ID/class to bootstrap modal.
It's necessary to assign a class to the editor main modal as sometimes I have multiple editors per page and they need different styling. I'm currently using the open event to add a custom class to the editor.
.on('open', function (e, mode, action) {
$('div.DTE').addClass('DTED_Stacked');
})
I'm unsure if there is a better way, but it works for me right now. However it would be a nice addition to have a className
option added to core options. Thoughts?
This question has an accepted answers - jump to answer
Answers
The only change I would suggest is to use
displayNode()
to get the display element rather thandiv.DTE
. It will basically do the same thing though.The other thing to mention would be that you might need to remove classes that were previously added by other event handlers.
Allan
Thanks for the link to displayNode which worked as described. Maybe for the next version you could add a
className
option to avoid relying on an event and to also manually remove existing classes.