• When creating two different custom styles using different classes and then trying to switch between the two the classes do not get replaced, instead it gets added. Example if you select a custom style with a tag say H1 with a class of green and then change it to a different H1 tag with a class of blue, both the green and blue classes are present. If you then switch to the default H1 with no classes the classes do not get remove.

    Any thoughts on this?

Viewing 1 replies (of 1 total)
  • Plugin Author Tim Reeves

    (@tim-reeves)

    I just tried adding and removing inline styles which create new tags, e.g. span or cite. This seems to work OK. If the same text is selected, then the menu item is higlighted if a custom style applies, and clicking it agin removes the style.
    But you’re talking about something else, where classes are added or (hopefully) removed. You’re talking about the “selector” case where a calss is applied. I use that very seldom myself. In fact I only have one example at hand. Adding or removing the class seems to work fine too, in the same was as when tags are added or removed. If TinyMCE gets mixed up when it’s about adding or deleting more than one class on the same element, then I don’t expect that there is mcuh I could do about it. My plugin only sets things up as config for TinyMCE, then it’s up to TinyMCE to get it right.
    Perhaps it will work for you if you do it in a disciplined way: First remove the green, and then add the blue?
    Sorry I can’t do more for you now – am in the process of moving house )-:

Viewing 1 replies (of 1 total)
  • The topic ‘remove classes when switching from one custom styles to another’ is closed to new replies.