I want to add and remove classes to a selected element, adding classes is working well, but removing them is not
var componentModel = editor.getSelected();
componentModel.addClass('form-color');
I want to be able to do
componentModel.removeClass('form-color');
But its throwing an error.
I'd be grateful if someone could share the correct syntax
Looking at
https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/Component.js#L276
I would say removeClass is not implemented.
If you know the other classes I think you can do setClass with an array that don't have the class you want to remove
That worked great, thanks for your help :)
I'll add removeClass in the next release
I think that would be cool 馃憤
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I'll add
removeClassin the next release