Ticket #8055: 8055_3.patch

File 8055_3.patch, 1.6 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/table/dialogs/table.js

     
    523523                                                                                {
    524524                                                                                        var caption = nodeList.getItem( 0 );
    525525
    526                                                                                         var innerHtml = caption.getHtml().replace(/<br>\s*$/i, ''),
    527                                                                                                 innerText = caption.getText();
    528 
    529                                                                                         if ( innerHtml != innerText )
     526                                                                                        var firstElementChild = caption.getFirst( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) )
     527                                                                                        if ( firstElementChild && !firstElementChild.equals( caption.getBogus() ) )
    530528                                                                                        {
    531529                                                                                                this.disable();
    532                                                                                                 this.setValue( innerText );
     530                                                                                                this.setValue( caption.getText() );
    533531                                                                                                return;
    534532                                                                                        }
    535533
     
    547545                                                                                if ( caption )
    548546                                                                                {
    549547                                                                                        if ( captionElement.count() > 0 )
    550                                                                                         {
    551548                                                                                                captionElement = captionElement.getItem( 0 );
    552                                                                                                 captionElement.setHtml( '' );
    553                                                                                         }
    554549                                                                                        else
    555550                                                                                        {
    556551                                                                                                captionElement = new CKEDITOR.dom.element( 'caption', editor.document );
    557                                                                                                 if ( table.getChildCount() )
    558                                                                                                         captionElement.insertBefore( table.getFirst() );
    559                                                                                                 else
    560                                                                                                         captionElement.appendTo( table );
     552                                                                                                captionElement.appendTo( table, 1 );
    561553                                                                                        }
    562                                                                                         captionElement.append( new CKEDITOR.dom.text( caption, editor.document ) );
     554
     555                                                                                        captionElement.setText( caption );
    563556                                                                                }
    564557                                                                                else if ( captionElement.count() > 0 )
    565558                                                                                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy