Ticket #4117: 4117.patch

File 4117.patch, 3.0 KB (added by Garry Yao, 15 years ago)
  • CHANGES.html

     
    187187                <li><a href="http://dev.fckeditor.net/ticket/4097">#4097</a> : No undo/redo support for fontColor and backgroundColor buttons.</li>
    188188                <li><a href="http://dev.fckeditor.net/ticket/4111">#4111</a> : Fixed apply block style after inline style applied on full document error.</li>
    189189                <li><a href="http://dev.fckeditor.net/ticket/3622">#3622</a> : Fixed shift enter with selection not deleting highlighted text.</li>
     190                <li><a href="http://dev.fckeditor.net/ticket/4117">#4117</a> : Fixed dialog error when transforming image into button.</li>
    190191        </ul>
    191192        <h3>
    192193                CKEditor 3.0 RC</h3>
  • _source/plugins/image/dialogs/image.js

     
    261261                                // Edit existing Image.
    262262                                if ( this.imageEditMode )
    263263                                {
    264                                         var imgTagName = this.imageEditMode,
    265                                                 removeObj = this.imageElement;
     264                                        var imgTagName = this.imageEditMode;
    266265
    267266                                        // Image dialog and Input element.
    268267                                        if ( dialogType == 'image' && imgTagName == 'input' && confirm( editor.lang.image.button2Img ) )
     
    271270                                                imgTagName = 'img';
    272271                                                this.imageElement = editor.document.createElement( 'img' );
    273272                                                this.imageElement.setAttribute( 'alt', '' );
    274                                                 removeObj.insertBeforeMe( this.imageElement );
    275                                                 removeObj.remove( false );
    276273
    277274                                        }
    278275                                        // ImageButton dialog and Image element.
     
    287284                                                                alt : ''
    288285                                                        }
    289286                                                );
    290                                                 removeObj.insertBeforeMe( this.imageElement );
    291                                                 removeObj.remove( false );
    292287                                        }
     288                                        editor.insertElement( this.imageElement );
    293289                                }
    294290                                else    // Create a new image.
    295291                                {
     
    312308                                this.commitContent( IMAGE, this.imageElement );
    313309                                this.commitContent( LINK, this.linkElement );
    314310
     311                                debugger;
    315312                                // Insert a new Image.
    316313                                if ( !this.imageEditMode )
    317314                                {
     
    320317                                                //Insert a new Link.
    321318                                                if ( !this.linkEditMode )
    322319                                                {
    323                                                         this.linkElement.append( this.imageElement, false );
    324320                                                        editor.insertElement( this.linkElement );
     321                                                        this.linkElement.append( this.imageElement, false );
    325322                                                }
    326323                                                else    //Link already exists, image not.
    327324                                                        this.linkElement.append( this.imageElement, false );
     
    334331                                        //Add a new link element.
    335332                                        if ( !this.linkEditMode && this.addLink )
    336333                                        {
    337                                                 this.imageElement.insertBeforeMe( this.linkElement );
     334                                                editor.insertElement( this.linkElement );
    338335                                                this.imageElement.appendTo( this.linkElement );
    339336                                        }
    340337                                        //Remove Link, Image exists.
    341338                                        else if ( this.linkEditMode && !this.addLink )
    342                                                 this.linkElement.remove( true );
     339                                                this.editor.insertElement( this.imageElement );
    343340                                }
    344341                        },
    345342                        onLoad : function()
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy