Ticket #7294: 7294_2.patch

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

     
    265265        // If the element direction changed, we need to switch the margins of
    266266        // the element and all its children, so it will get really reflected
    267267        // like a mirror. (#5910)
     268        function isInDoc( el, doc )
     269        {
     270                var html = doc.getBody().getParent();
     271                while ( el )
     272                {
     273                        if ( el.equals( html ) )
     274                                return true;
     275                        el = el.getParent();
     276                }
     277                return false;
     278        }
    268279        function dirChangeNotifier( org )
    269280        {
    270281                var isAttribute = org == elementProto.setAttribute,
     
    275286                {
    276287                        if ( !this.getDocument().equals( CKEDITOR.document ) )
    277288                        {
    278                                 var orgDir, dir;
    279                                 if ( name == ( isAttribute || isRemoveAttribute ? 'dir' : 'direction' ) ||
    280                                          name == 'style' && ( isRemoveAttribute || dirStyleRegexp.test( val ) ) )
     289                                var orgDir;
     290                                if ( ( name == ( isAttribute || isRemoveAttribute ? 'dir' : 'direction' ) ||
     291                                         name == 'style' && ( isRemoveAttribute || dirStyleRegexp.test( val ) ) ) && isInDoc( this, this.getDocument() ) )
    281292                                {
    282293                                        orgDir = this.getDirection( 1 );
    283294                                        var retval = org.apply( this, arguments );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy