Ticket #2895: 2895.patch

File 2895.patch, 1.5 KB (added by Frederico Caldeira Knabben, 16 years ago)
  • _source/plugins/selection/plugin.js

     
    123123        {
    124124                var retval = this.document ? this.document.getSelection() : null;
    125125
    126                 /**
    127                  * IE BUG: The selection's document may be a different document than the
    128                  * editor document. Return null if that's the case.
    129                  */
    130                 if ( retval && CKEDITOR.env.ie )
     126                if ( retval )
    131127                {
    132                         var range = retval.getNative().createRange();
    133                         if ( !range )
    134                                 return null;
    135                         else if ( range.item )
    136                                 return range.item(0).ownerDocument == this.document.$ ? retval : null;
    137                         else
    138                                 return range.parentElement().ownerDocument == this.document.$ ? retval : null;
     128                        /**
     129                         * IE BUG: The selection's document may be a different document than the
     130                         * editor document. Return null if that's the case.
     131                         */
     132                        if ( CKEDITOR.env.ie )
     133                        {
     134                                var range = retval.getNative().createRange();
     135                                if ( !range )
     136                                        return null;
     137                                else if ( range.item )
     138                                        return range.item(0).ownerDocument == this.document.$ ? retval : null;
     139                                else
     140                                        return range.parentElement().ownerDocument == this.document.$ ? retval : null;
     141                        }
     142
     143                        retval.onSelectionSet = CKEDITOR.tools.bind( checkSelectionChangeTimeout, this );
    139144                }
    140145
    141                 retval.onSelectionSet = CKEDITOR.tools.bind( checkSelectionChangeTimeout, this );
    142146                return retval;
    143147        };
    144148
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy