Ticket #6332: 6332_2.patch

File 6332_2.patch, 5.8 KB (added by Paweł Horzela, 14 years ago)

Patch

  • _source/plugins/dialog/plugin.js

     
    799799                 */
    800800                reset : (function()
    801801                {
    802                         var fn = function( widget ){ if ( widget.reset ) widget.reset( 1 ); };
     802                        var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
    803803                        return function(){ this.foreach( fn ); return this; };
    804804                })(),
    805805
     
    23962396                /**
    23972397                 * Sets the value of this dialog UI object.
    23982398                 * @param {Object} value The new value.
    2399                  * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
    24002399                 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
    24012400                 * @example
    24022401                 * uiElement.setValue( 'Dingo' );
    24032402                 */
    2404                 setValue : function( value, noChangeEvent )
     2403                setValue : function( value )
    24052404                {
    24062405                        this.getInputElement().setValue( value );
    2407                         !noChangeEvent && this.fire( 'change', { value : value } );
     2406                        this.fire( 'change', { value : value } );
    24082407                        return this;
    24092408                },
    24102409
  • _source/plugins/dialogadvtab/plugin.js

     
    4343        }
    4444}
    4545
     46var isUpdating;
     47
    4648CKEDITOR.plugins.add( 'dialogadvtab',
    4749{
    4850        /**
     
    142144
    143145                                                updateStyle : function( name, value )
    144146                                                {
     147                                                        if ( isUpdating )
     148                                                                return;
     149                                                       
     150                                                        // Flag to avoid recursion.
     151                                                        isUpdating = 1;
     152                                                       
    145153                                                        var styles = this.getValue();
    146154
    147155                                                        // Remove the current value.
     
    159167                                                                styles += name + ': ' + value;
    160168                                                        }
    161169
    162                                                         this.setValue( styles, true );
    163 
     170                                                        this.setValue( styles );
     171                                                       
     172                                                        isUpdating = 0;
    164173                                                },
    165174
    166175                                                setup : setupAdvParams,
  • _source/plugins/dialogui/plugin.js

     
    5959                        return this.getValue() != this.getInitValue();
    6060                },
    6161
    62                 reset : function( noChangeEvent )
     62                reset : function()
    6363                {
    64                         this.setValue( this.getInitValue(), noChangeEvent );
     64                        this.setValue( this.getInitValue() );
    6565                },
    6666
    6767                setInitValue : function()
     
    10611061                                setValue : function( value )
    10621062                                {
    10631063                                        !value && ( value = '' );
    1064                                         return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments );
     1064                                        return CKEDITOR.ui.dialog.uiElement.prototype.setValue.call( this, value );
    10651065                                },
    10661066
    10671067                                keyboardFocusable : true
     
    11561156                                 * Sets the state of the checkbox.
    11571157                                 * @example
    11581158                                 * @param {Boolean} true to tick the checkbox, false to untick it.
    1159                                  * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
    11601159                                 */
    1161                                 setValue : function( checked, noChangeEvent )
     1160                                setValue : function( checked )
    11621161                                {
    11631162                                        this.getInputElement().$.checked = checked;
    1164                                         !noChangeEvent && this.fire( 'change', { value : checked } );
     1163                                        this.fire( 'change', { value : checked } );
    11651164                                },
    11661165
    11671166                                /**
     
    12231222                                 * Checks one of the radio buttons in this button group.
    12241223                                 * @example
    12251224                                 * @param {String} value The value of the button to be chcked.
    1226                                  * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
    12271225                                 */
    1228                                 setValue : function( value, noChangeEvent )
     1226                                setValue : function( value )
    12291227                                {
    12301228                                        var children = this._.children,
    12311229                                                item;
    12321230                                        for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
    12331231                                                item.getElement().$.checked = ( item.getValue() == value );
    1234                                         !noChangeEvent && this.fire( 'change', { value : value } );
     1232                                        this.fire( 'change', { value : value } );
    12351233                                },
    12361234
    12371235                                /**
  • _source/plugins/table/dialogs/table.js

     
    3232
    3333                        onLoad : function()
    3434                        {
    35                                 var dialog = this;
     35                                var dialog = this,
     36                                        isUpdating;
    3637
    3738                                var styles = dialog.getContentElement( 'advanced', 'advStyles' );
    3839
     
    4041                                {
    4142                                        styles.on( 'change', function( evt )
    4243                                                {
     44                                                         if ( isUpdating )
     45                                                                return;
     46                                                               
     47                                                        // Flag to avoid recursion.
     48                                                        isUpdating = 1;
     49                                                       
    4350                                                        // Synchronize width value.
    4451                                                        var width = this.getStyle( 'width', '' ),
    4552                                                                txtWidth = dialog.getContentElement( 'info', 'txtWidth' ),
     
    5259                                                                width = parseInt( width, 10 );
    5360                                                        }
    5461
    55                                                         txtWidth && txtWidth.setValue( width, true );
    56                                                         cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents', true );
     62                                                        txtWidth && txtWidth.setValue( width );
     63                                                        cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents' );
    5764
    5865                                                        // Synchronize height value.
    5966                                                        var height = this.getStyle( 'height', '' ),
    6067                                                                txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
    6168
    6269                                                        height && ( height = parseInt( height, 10 ) );
    63                                                         txtHeight && txtHeight.setValue( height, true );
     70                                                        txtHeight && txtHeight.setValue( height );
     71                                                       
     72                                                        isUpdating = 0;
    6473                                                });
    6574                                }
    6675                        },
     
    444453
    445454                                                                                                                if ( styles )
    446455                                                                                                                {
    447                                                                                                                         var value = this.getValue();
     456                                                                                                                        var value = this.getValue() || this.getInitValue();
    448457
    449458                                                                                                                        if ( value )
    450459                                                                                                                                value += this.getDialog().getContentElement( 'info', 'cmbWidthType' ).getValue() == 'percents' ? '%' : 'px';
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy