Ticket #3238: 3238.patch

File 3238.patch, 3.2 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/dialog/plugin.js

     
    121121                        editor : editor,
    122122                        element : themeBuilt.element,
    123123                        name : dialogName,
    124                         contentSize : { width : 0, height : 0 },
    125124                        size : { width : 0, height : 0 },
    126125                        updateSize : false,
    127126                        contents : {},
     
    144143                };
    145144
    146145                this.parts = themeBuilt.parts;
     146                this.contentSize = { width : 0, height : 0 };
    147147
    148148                // Call the CKEDITOR.event constructor to initialize this instance.
    149149                CKEDITOR.event.call( this );
     
    436436                {
    437437                        return function( width, height )
    438438                        {
    439                                 if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height )
     439                                if ( this.contentSize && this.contentSize.width == width && this.contentSize.height == height )
    440440                                        return;
    441441
    442442                                CKEDITOR.dialog.fire( 'resize',
     
    447447                                                height : height
    448448                                        }, this._.editor );
    449449
    450                                 this._.contentSize = { width : width, height : height };
     450                                this.contentSize = { width : width, height : height };
    451451                                this._.updateSize = true;
    452452                        };
    453453                })(),
     
    463463                        if ( !this._.updateSize )
    464464                                return this._.size;
    465465                        var element = this._.element.getFirst();
    466                         var size = this._.size = { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0};
     466                        var size = this._.size = CKEDITOR.dialog.fire( 'getSize',
     467                                        {
     468                                                dialog : this,
     469                                                skin : this._.editor.skinName
     470                                        }, this._.editor );
    467471
    468                         // If either the offsetWidth or offsetHeight is 0, the element isn't visible.
    469                         this._.updateSize = !size.width || !size.height;
    470 
     472                        this._.updateSize = false;
    471473                        return size;
    472474                },
    473475
  • _source/skins/office2003/skin.js

     
    6969                                        el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    7070                                },
    7171                                0 );
     72
     73                        evt.stop();
    7274                });
     75
     76        CKEDITOR.dialog.on( 'getSize', function( evt )
     77                {
     78                        var dialog = evt.data.dialog, skin = evt.data.skin;
     79                        if ( skin != 'office2003' )
     80                                return;
     81
     82                        var dx = 54;
     83                        var dy = dialog.getPageCount() < 2 ? 96 : 119;
     84
     85                        evt.stop();
     86                        evt.data = { width : dialog.contentSize.width + dx, height : dialog.contentSize.height + dy };
     87                } );
    7388}
  • _source/skins/v2/skin.js

     
    6969                                        el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    7070                                },
    7171                                0 );
    72                 });
     72
     73                        evt.stop();
     74                } );
     75
     76        CKEDITOR.dialog.on( 'getSize', function( evt )
     77                {
     78                        var dialog = evt.data.dialog, skin = evt.data.skin;
     79                        if ( skin != 'v2' )
     80                                return;
     81
     82                        var dx = 54;
     83                        var dy = dialog.getPageCount() < 2 ? 96 : 119;
     84
     85                        evt.stop();
     86                        evt.data = { width : dialog.contentSize.width + dx, height : dialog.contentSize.height + dy };
     87                } );
    7388}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy