X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fthemes%2Fdefault%2Ftheme.js;h=b1e94ba8b1bbc55da452839319c4c174ed213320;hp=960ee0b507ccf4c0f43d8ef0ecb4e70581584e79;hb=4e90e78dc97789709ee7404359a5517540c27553;hpb=8f6c203fdaa543c3bca40baea6ae4ddcdf1a77f5 diff --git a/_source/themes/default/theme.js b/_source/themes/default/theme.js index 960ee0b..b1e94ba 100644 --- a/_source/themes/default/theme.js +++ b/_source/themes/default/theme.js @@ -168,6 +168,18 @@ CKEDITOR.themes.add( 'default', (function() // Disable browser context menu for editor's chrome. container.disableContextMenu(); + // Use a class to indicate that the current selection is in different direction than the UI. + editor.on( 'contentDirChanged', function( evt ) + { + var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class'; + + container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' ); + + // Put the mixed direction class on the respective element also for shared spaces. + var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ]; + toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' ); + }); + editor.fireOnce( 'themeLoaded' ); editor.fireOnce( 'uiReady' ); },