I'm trying all day to set up a peristant style attribute to the body tag of the ckeditor instance. I could not find something like bodyStyle in ckeditor.config api (only bodyId and bodyClass). So I was trying it myself, with the following solution (jQuery is used):
$(this).find('textarea.editor').ckeditor().ckeditorGet().on( 'instanceReady', function( e ){
var documentWrapper = e.editor.document,
documentNode = documentWrapper.$,
inh = $(documentNode.body);
inh.css('background', inheritParentBackground);
});
Wich is working quite well, but after I call .updateElement() or if i click the source button twice, it will removes all the styles again and 'instanceReady' is not called again. I tried to fire it manually, but then it runs the style update first and gets directly overwritten from ckeditor.
What I'm actual trying to do: I want to edit a Div in an homepage, after klicking edit a ajax popup apears with the ckeditor and i want the Editor to have the same height, width and Background and i can not handle this over bodyId or bodyClass, so I guess I need a bodyStyle or somebody has a diffrent idea.