Ticket #8429: 8429.patch

File 8429.patch, 802 bytes (added by Frederico Caldeira Knabben, 13 years ago)
  • _source/plugins/wysiwygarea/plugin.js

     
    803803                                                        domDocument.on( 'selectionchange', function()
    804804                                                        {
    805805                                                                var body = domDocument.getBody(),
    806                                                                         range = editor.getSelection().getRanges()[ 0 ];
     806                                                                        sel = editor.getSelection(),
     807                                                                        range = sel && sel.getRanges()[ 0 ];
    807808
    808809                                                                if ( body.getHtml().match( /^<p>&nbsp;<\/p>$/i )
    809                                                                         && range.startContainer.equals( body ) )
     810                                                                        && range && range.startContainer.equals( body ) )
    810811                                                                {
    811812                                                                        // Avoid the ambiguity from a real user cursor position.
    812813                                                                        setTimeout( function ()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy