Ticket #3129: 3129.patch

File 3129.patch, 2.4 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/sourcearea/plugin.js

     
    125125                                        editor.mode == 'source' ?
    126126                                                CKEDITOR.TRISTATE_ON :
    127127                                                CKEDITOR.TRISTATE_OFF );
     128                                               
     129                                // Force selection change to update corresponding commands states.     
     130                                if ( editor.mode == 'wysiwyg' )
     131                                        editor.checkSelection();
     132                                else
     133                                        editor.fire( 'selectionChange', { selection : null, path : { elements: [] }, element : null } );
    128134                        });
    129135        }
    130136});
  • _source/plugins/link/plugin.js

     
    5858                                 * for this in Firefox. So we must detect the state by element paths.
    5959                                 */
    6060                                var command = editor.getCommand( 'unlink' ),
    61                                         element = evt.data.path.lastElement.getAscendant( 'a', true );
     61                                        element = evt.data.path.lastElement && evt.data.path.lastElement.getAscendant( 'a', true );
    6262                                if ( element && element.getName() == 'a' && element.getAttribute( 'href' ) )
    6363                                        command.setState( CKEDITOR.TRISTATE_OFF );
    6464                                else
  • _source/plugins/elementspath/plugin.js

     
    5353                        editor.on( 'selectionChange', function( ev )
    5454                                {
    5555                                        var env = CKEDITOR.env;
    56 
    57                                         var selection = ev.data.selection;
    58 
    59                                         var element = selection.getStartElement(),
     56                                        var element = ev.data.element,
    6057                                                html = [],
    6158                                                elementsList = this._.elementsPath.list = [];
    6259
  • _source/plugins/selection/plugin.js

     
    147147        {
    148148                delete this._.selectionPreviousPath;
    149149        };
    150 
     150       
     151        /**
     152         * Force firing of the 'selectionChange' event.
     153         */
     154        CKEDITOR.editor.prototype.checkSelection = checkSelectionChange;
     155       
    151156        /**
    152157         * Gets the current selection from the document.
    153158         * @returns {CKEDITOR.dom.selection} A selection object.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy