Ticket #7158: 7158.patch

File 7158.patch, 2.4 KB (added by Sa'ar Zac Elias, 13 years ago)
  • _source/plugins/iframe/dialogs/iframe.js

     
    4848                        title : iframeLang.title,
    4949                        minWidth : 350,
    5050                        minHeight : 260,
     51                        onLoad : function()
     52                        {
     53                                var dialog = this,
     54                                        styles = dialog.getContentElement( 'advanced', 'advStyles' );
     55
     56                                styles && styles.on( 'change', function()
     57                                        {
     58                                                // Synchronize width value.
     59                                                var width = parseInt( this.getStyle( 'width', '' ) || '', 10 ),
     60                                                        txtWidth = dialog.getContentElement( 'info', 'width' );
     61
     62                                                txtWidth && txtWidth.setValue( width, true );
     63
     64                                                // Synchronize height value.
     65                                                var height = parseInt( this.getStyle( 'height', '' ) || '', 10 ),
     66                                                        txtHeight = dialog.getContentElement( 'info', 'height' );
     67
     68                                                txtHeight && txtHeight.setValue( height, true );
     69                                        });
     70                        },
    5171                        onShow : function()
    5272                        {
    5373                                // Clear previously saved elements.
     
    6383
    6484                                        this.setupContent( iframeNode, fakeImage );
    6585                                }
     86
     87                                // Call the onChange method for the widht and height fields so
     88                                // they get reflected into the Advanced tab.
     89                                var widthInput = this.getContentElement( 'info', 'width' ),
     90                                        heightInput = this.getContentElement( 'info', 'height' );
     91                                widthInput && widthInput.onChange();
     92                                heightInput && heightInput.onChange();
    6693                        },
    6794                        onOk : function()
    6895                        {
     
    139166                                                                                commitValue.apply( this, arguments );
    140167                                                                                if ( this.getValue() )
    141168                                                                                        extraStyles.width = this.getValue() + 'px';
     169                                                                        },
     170                                                                        onChange : function()
     171                                                                        {
     172                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     173                                                                                        value = this.getValue();
     174                                                                                styles && styles.updateStyle( 'width', value &&  ( value + 'px' ) );
    142175                                                                        }
    143176                                                                },
    144177                                                                {
     
    163196                                                                                commitValue.apply( this, arguments );
    164197                                                                                if ( this.getValue() )
    165198                                                                                        extraStyles.height = this.getValue() + 'px';
     199                                                                        },
     200                                                                        onChange : function()
     201                                                                        {
     202                                                                                var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ),
     203                                                                                        value = this.getValue();
     204                                                                                styles && styles.updateStyle( 'height', value &&  ( value + 'px' ) );
    166205                                                                        }
    167206                                                                },
    168207                                                                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy