Ticket #6166: 6166.patch

File 6166.patch, 1.2 KB (added by Charlie, 14 years ago)
  • _source/plugins/maximize/plugin.js

     
    287287
    288288                                                // Toggle button label.
    289289                                                var button = this.uiItems[ 0 ];
    290                                                 var label = ( this.state == CKEDITOR.TRISTATE_OFF )
    291                                                         ? lang.maximize : lang.minimize;
    292                                                 var buttonNode = editor.element.getDocument().getById( button._.id );
    293                                                 buttonNode.getChild( 1 ).setHtml( label );
    294                                                 buttonNode.setAttribute( 'title', label );
    295                                                 buttonNode.setAttribute( 'href', 'javascript:void("' + label + '");' );
     290                                                // Only try to change the button if it exists (#6166)
     291                                                if( button )
     292                                                {
     293                                                        var label = ( this.state == CKEDITOR.TRISTATE_OFF )
     294                                                                ? lang.maximize : lang.minimize;
     295                                                        var buttonNode = editor.element.getDocument().getById( button._.id );
     296                                                        buttonNode.getChild( 1 ).setHtml( label );
     297                                                        buttonNode.setAttribute( 'title', label );
     298                                                        buttonNode.setAttribute( 'href', 'javascript:void("' + label + '");' );
     299                                                }
    296300
    297301                                                // Restore selection and scroll position in editing area.
    298302                                                if ( editor.mode == 'wysiwyg' )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy