Ticket #6901: 6901_2.patch

File 6901_2.patch, 2.0 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/bidi/plugin.js

     
    5151        function handleMixedDirContent( evt )
    5252        {
    5353                var editor = evt.editor,
    54                         chromeRoot = editor.container.getChild( 1 ),
    5554                        directionNode = evt.data.path.block || evt.data.path.blockLimit;
    5655
    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.setMixedDirectionClass( directionNode && editor.lang.dir != directionNode.getComputedStyle( 'direction' ) );
    6157        }
    6258
    6359        /**
  • _source/themes/default/theme.js

     
    341341};
    342342
    343343/**
     344 * Applies and removes a class to all UI wrappers that indicates mixed BiDi contents in
     345 * the area surrounding the current selection.
     346 * @param {Boolean} [state] Whether the surrounding contetns include mixed BiDi contents.
     347 * @example
     348 * editor.setMixedDirectionClass( true );
     349 */
     350CKEDITOR.editor.prototype.setMixedDirectionClass = function( state )
     351{
     352        var func = ( state ? 'add' : 'remove' ) + 'Class';
     353
     354        this.container.getChild( 1 )[ func ]( 'cke_mixed_dir_content' );
     355
     356        // Put the mixed direction class on the respective element also for shared spaces.
     357        var toolbarSpace = this.sharedSpaces && this.sharedSpaces[ this.config.toolbarLocation ];
     358        if ( toolbarSpace )
     359                toolbarSpace.getParent().getParent()[ func ]( 'cke_mixed_dir_content' );
     360};
     361
     362/**
    344363 * Makes it possible to place some of the editor UI blocks, like the toolbar
    345364 * and the elements path, into any element in the page.
    346365 * The elements used to hold the UI blocks can be shared among several editor
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy