Hi,
I using CKEDITOR.config.contentsLangDirection = 'ltr' in my config file.
I'm trying to add an event to the editor that checks if the length of the data is 1 and if so, change contentsLangDirection to 'rtl'.
So I have this:
CKEDITOR.instances['post-text'].on('change', function(event) { if ($(this.getData()).text().trim().length === 1) { // change contentsLangDirection to rtl - how? } }
But I can't figure out how to actually change the direction. Any ideas?
Thanks a lot.
After thinking a bit more
After thinking a bit more about this, I don't want to change contentsLangDirection, but rather only the CSS of the current element. For example, if there is only single character in the current element, add an attribute to the element
Is that possible? Please note that some web-based editors has this feature (Gmail & Facebook for example).