I’m unable to figure out how to modify the CKEditor 4 iframe’s body background color. I’ve tried multiple solution but unable to figure out how can i achieve.
(function ($, Drupal, CKEDITOR) {
CKEDITOR.plugins.add(‘cellbackgroundcolorplugin’, {
icons: ‘backgroundIcon’,
init: function (editor) {
// Adding/Creating command.
editor.addCommand( 'cellBackground', {
exec: function(editor) {
if(style.checkActive( editor.elementPath(), editor )) {
editor.removeStyle( style );
}else {
editor.applyStyle(style);
}
}
});
// Register the button, when the button plugin is enabled
if (editor.ui.addButton) {
editor.ui.addButton('CellBackgroungColorPlugin', {
label: editor.config.backgroundIconLabel,
command: 'cellBackground',
toolbar: 'basicstyles',
icon: editor.config.backgroundIcon
})
}
},
});
})(jQuery, Drupal, CKEDITOR);
Expectation is that cell background color should be dynamically changed based on selected color