Ticket #3231: 3231.patch

File 3231.patch, 1.8 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/selection/plugin.js

     
    2121                                return;
    2222
    2323                        var firstElement = sel.getStartElement();
    24                         var currentPath = new CKEDITOR.dom.elementPath( firstElement );
     24                        var currentPath = new CKEDITOR.dom.elementPath( firstElement ),
     25                                rootPath = new CKEDITOR.dom.elementPath(
     26                                        sel.getRanges()[0].getCommonAncestor( true ) );
    2527
    2628                        if ( !currentPath.compare( this._.selectionPreviousPath ) )
    2729                        {
     
    2628                        if ( !currentPath.compare( this._.selectionPreviousPath ) )
    2729                        {
    2830                                this._.selectionPreviousPath = currentPath;
    29                                 this.fire( 'selectionChange', { selection : sel, path : currentPath, element : firstElement } );
     31                                this.fire( 'selectionChange',
     32                                        { selection : sel, path : currentPath, rootPath: rootPath, element : firstElement } );
    3033                        }
    3134                }
    3235                catch (e)
     
    3134                }
    3235                catch (e)
    3336                {}
    34         };
     37        }
    3538
    3639        var checkSelectionChangeTimer,
    3740                checkSelectionChangeTimeoutPending;
  • _source/plugins/styles/plugin.js

     
    4949
    5050                                        // Check the current state for the style defined for that
    5151                                        // callback.
    52                                         var currentState = callback.style.checkActive( ev.data.path ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
     52                                        var currentState = callback.style.checkActive( ev.data.rootPath ) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
    5353
    5454                                        // If the state changed since the last check.
    5555                                        if ( callback.state !== currentState )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy