Kunstmaan / BootstrapCK4-Skin

A Bootstrap inspired skin for CKeditor4
MIT License
59 stars 22 forks source link

Disable unsupported chameleon feature #5

Open danyaPostfactum opened 10 years ago

danyaPostfactum commented 10 years ago

The issue occurs on editor with builtin moono theme and with defined uiColor setting (even empty). Editor get partially styled by moono. This is because moono defines CKEDITOR.skin.chameleon function that adds some css. In fact this is a CKEditor issue (disabled skin should not inject its css). uiColor setting is added by CMS (in my case). So, we need to override CKEDITOR.skin.chameleon in skin.js:

CKEDITOR.skin.chameleon = function(){
    return '';
};
mdxs commented 10 years ago

@danyaPostfactum Could you put a link to any issue reported to CKEditor issue on this? Good to have a workaround, but perhaps it is/gets obsolete when CKEditor fixed/fixes it.

mdxs commented 10 years ago

Is this still an issue?

danyaPostfactum commented 10 years ago

I did not report this to ckeditor team. Anyway, this can not be fixed without breaking backwards compatibility in the ckeditor. It's how ckeditor works now: builtin skin (by CKBuilder) defines properties of CKEditor.skin object, such as name, icons and chameleon. If user wants another skin, it's file gets loaded and this skin overrides CKEditor.skin properties. So, if it will not override chameleon property, we get the problem. The only solution I can use: notify users, that setting uiColor can break some skins (that does not support "chameleon" feature)

mdxs commented 10 years ago

Thanks for expanding on the issue; even though I don't fully understand it at this point in time (a newbie ;-)

danyaPostfactum commented 10 years ago

I created jsfiddle for you: http://jsfiddle.net/danya_postfactum/dubhh1st/

danyaPostfactum commented 10 years ago

I use CKEditor in CMS. It allows user to specify skin and uiColor. By the way, I think it would be good to propose to CKEditor team a simple way to disable "chameleon": CKEDITOR.skin.chameleon = false So, we let CKEditor know that we don't support chameleon feature.