Ckeditor4 Enhancedimage Plugin Image Added Event Or: How To Add Custom Class To Image
I'm playing around with CKEditor4 and I want to add a custom class to all images that I inserted. Unfortunately it seems as the dataFilter rule which works for adding classes on in
Solution 1:
If you just want to add a custom class for inserted images, you could easily listen to dialogHide
event:
editor.on( 'dialogHide', function( evt ) {
var widget = evt.data.widget;
if ( widget && widget.name === 'image' && widget.element ) {
widget.element.addClass( 'img-fluid' );
}
} );
Post a Comment for "Ckeditor4 Enhancedimage Plugin Image Added Event Or: How To Add Custom Class To Image"