Ticket #3238: 3238_2.patch

File 3238_2.patch, 3.3 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _source/plugins/dialog/plugin.js

     
    144144                };
    145145
    146146                this.parts = themeBuilt.parts;
     147               
     148                // Set the startup styles for the dialog, avoiding it enlarging the
     149                // page size on the dialog creation.
     150                this.parts.dialog.setStyles(
     151                        {
     152                                position : 'absolute',
     153                                top : 0,
     154                                left: 0,
     155                                visibility : 'hidden'
     156                        });
    147157
    148158                // Call the CKEDITOR.event constructor to initialize this instance.
    149159                CKEDITOR.event.call( this );
     
    506516
    507517                                element.setStyles(
    508518                                                {
    509                                                         'left' : x + 'px',
    510                                                         'top' : y + 'px'
     519                                                        'left'  : ( x > 0 ? x : 0 ) + 'px',
     520                                                        'top'   : ( y > 0 ? y : 0 ) + 'px'
    511521                                                });
    512522                        };
    513523                })(),
     
    541551                        // First, set the dialog to an appropriate size.
    542552                        this.resize( definition.minWidth, definition.minHeight );
    543553
    544                         // Rearrange the dialog to the middle of the window.
    545                         var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
    546                         var dialogSize = this.getSize();
    547                         this.move( ( viewSize.width - dialogSize.width ) / 2, ( viewSize.height - dialogSize.height ) / 2 );
    548 
    549554                        // Select the first tab by default.
    550555                        this.selectPage( this.definition.contents[0].id );
    551556
     
    585590                        // Reset the hasFocus state.
    586591                        this._.hasFocus = false;
    587592
    588                         // Execute onLoad for the first show.
    589                         this.fireOnce( 'load', {} );
    590                         this.fire( 'show', {} );
    591 
    592593                        // Save the initial values of the dialog.
    593594                        this.foreach( function( contentObj ) { contentObj.setInitValue && contentObj.setInitValue(); } );
     595
     596                        // Rearrange the dialog to the middle of the window.
     597                        CKEDITOR.tools.setTimeout( function()
     598                                {
     599                                        var viewSize = CKEDITOR.document.getWindow().getViewPaneSize();
     600                                        var dialogSize = this.getSize();
     601
     602                                        this.move( ( viewSize.width - dialogSize.width ) / 2, ( viewSize.height - dialogSize.height ) / 2 );
     603
     604                                        this.parts.dialog.setStyle( 'visibility', '' );
     605
     606                                        // Execute onLoad for the first show.
     607                                        this.fireOnce( 'load', {} );
     608                                        this.fire( 'show', {} );
     609                                },
     610                                100, this );
    594611                },
    595612
    596613                /**
     
    653670                        var element = this._.element;
    654671                        if ( !element.getParent() )
    655672                                return;
     673
    656674                        element.remove();
     675                        this.parts.dialog.setStyle( 'visibility', 'hidden' );
    657676
    658677                        // Unregister all access keys associated with this dialog.
    659678                        unregisterAccessKey( this );
  • _source/skins/office2003/skin.js

     
    6868                                        el = innerDialog.getChild( 5 );
    6969                                        el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    7070                                },
    71                                 0 );
     71                                100 );
    7272                });
    7373}
  • _source/skins/v2/skin.js

     
    6868                                        el = innerDialog.getChild( 5 );
    6969                                        el.setStyle( 'height', ( body.$.offsetHeight - 31 - 14 ) + 'px' );
    7070                                },
    71                                 0 );
     71                                100 );
    7272                });
    7373}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy