Ticket #6901: 6901_3.patch
File 6901_3.patch, 2.1 KB (added by , 13 years ago) |
---|
-
_source/plugins/bidi/plugin.js
51 51 function handleMixedDirContent( evt ) 52 52 { 53 53 var editor = evt.editor, 54 chromeRoot = editor.container.getChild( 1 ),55 54 directionNode = evt.data.path.block || evt.data.path.blockLimit; 56 55 57 if ( directionNode && editor.lang.dir != directionNode.getComputedStyle( 'direction' ) ) 58 chromeRoot.addClass( 'cke_mixed_dir_content' ); 59 else 60 chromeRoot.removeClass( 'cke_mixed_dir_content' ); 56 editor.fire( 'contentDirChanged', directionNode ? directionNode.getComputedStyle( 'direction' ) : editor.lang.dir ); 61 57 } 62 58 63 59 /** … … 278 274 * @param {Object} eventData.node The element that is being changed. 279 275 * @param {String} eventData.dir The new direction. 280 276 */ 277 278 /** 279 * Fired when the language direction in the specific cursor position is changed 280 * @name CKEDITOR.editor#contentDirChanged 281 * @event 282 * @param {String} eventData The direction in the current position. 283 */ -
_source/themes/default/theme.js
168 168 // Disable browser context menu for editor's chrome. 169 169 container.disableContextMenu(); 170 170 171 // Use a class to indicate that the current selection is in different direction than the UI. 172 editor.on( 'contentDirChanged', function( evt ) 173 { 174 var func = ( editor.lang.dir != evt.data ? 'add' : 'remove' ) + 'Class'; 175 176 container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' ); 177 178 // Put the mixed direction class on the respective element also for shared spaces. 179 var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ]; 180 toolbarSpace && toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' ); 181 }); 182 171 183 editor.fireOnce( 'themeLoaded' ); 172 184 editor.fireOnce( 'uiReady' ); 173 185 },