Ticket #6137: 6137_3.patch

File 6137_3.patch, 5.7 KB (added by Sa'ar Zac Elias, 14 years ago)
  • _source/plugins/dialog/plugin.js

     
    762762                        for ( var i in this._.contents )
    763763                        {
    764764                                for ( var j in this._.contents[i] )
    765                                         fn( this._.contents[i][j]);
     765                                        fn( this._.contents[i][j] );
    766766                        }
    767767                        return this;
    768768                },
     
    775775                 */
    776776                reset : (function()
    777777                {
    778                         var fn = function( widget ){ if ( widget.reset ) widget.reset(); };
     778                        var fn = function( widget ){ if ( widget.reset ) widget.reset( 1 ); };
    779779                        return function(){ this.foreach( fn ); return this; };
    780780                })(),
    781781
     
    23542354                /**
    23552355                 * Sets the value of this dialog UI object.
    23562356                 * @param {Object} value The new value.
     2357                 * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
    23572358                 * @returns {CKEDITOR.dialog.uiElement} The current UI element.
    23582359                 * @example
    23592360                 * uiElement.setValue( 'Dingo' );
    23602361                 */
    2361                 setValue : function( value )
     2362                setValue : function( value, noChangeEvent )
    23622363                {
    23632364                        this.getInputElement().setValue( value );
    2364                         this.fire( 'change', { value : value } );
     2365                        !noChangeEvent && this.fire( 'change', { value : value } );
    23652366                        return this;
    23662367                },
    23672368
  • _source/plugins/dialogadvtab/plugin.js

     
    4343        }
    4444}
    4545
    46 var isUpdating;
    47 
    4846CKEDITOR.plugins.add( 'dialogadvtab',
    4947{
    5048        /**
     
    144142
    145143                                                updateStyle : function( name, value )
    146144                                                {
    147                                                         if ( isUpdating )
    148                                                                 return;
    149 
    150                                                         // Flag to avoid recursion.
    151                                                         isUpdating = 1;
    152 
    153145                                                        var styles = this.getValue();
    154146
    155147                                                        // Remove the current value.
     
    167159                                                                styles += name + ': ' + value;
    168160                                                        }
    169161
    170                                                         this.setValue( styles );
     162                                                        this.setValue( styles, true );
    171163
    172                                                         isUpdating = 0;
    173164                                                },
    174165
    175166                                                setup : setupAdvParams,
  • _source/plugins/dialogui/plugin.js

     
    5959                        return this.getValue() != this.getInitValue();
    6060                },
    6161
    62                 reset : function()
     62                reset : function( noChangeEvent )
    6363                {
    64                         this.setValue( this.getInitValue() );
     64                        this.setValue( this.getInitValue(), noChangeEvent );
    6565                },
    6666
    6767                setInitValue : function()
     
    10611061                                setValue : function( value )
    10621062                                {
    10631063                                        !value && ( value = '' );
    1064                                         return CKEDITOR.ui.dialog.uiElement.prototype.setValue.call( this, value );
     1064                                        return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments );
    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.
    11591160                                 */
    1160                                 setValue : function( checked )
     1161                                setValue : function( checked, noChangeEvent )
    11611162                                {
    11621163                                        this.getInputElement().$.checked = checked;
    1163                                         this.fire( 'change', { value : checked } );
     1164                                        !noChangeEvent && this.fire( 'change', { value : checked } );
    11641165                                },
    11651166
    11661167                                /**
     
    12221223                                 * Checks one of the radio buttons in this button group.
    12231224                                 * @example
    12241225                                 * @param {String} value The value of the button to be chcked.
     1226                                 * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element.
    12251227                                 */
    1226                                 setValue : function( value )
     1228                                setValue : function( value, noChangeEvent )
    12271229                                {
    12281230                                        var children = this._.children,
    12291231                                                item;
    12301232                                        for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ )
    12311233                                                item.getElement().$.checked = ( item.getValue() == value );
    1232                                         this.fire( 'change', { value : value } );
     1234                                        !noChangeEvent && this.fire( 'change', { value : value } );
    12331235                                },
    12341236
    12351237                                /**
  • _source/plugins/table/dialogs/table.js

     
    3232
    3333                        onLoad : function()
    3434                        {
    35                                 var dialog = this,
    36                                         isUpdating;
     35                                var dialog = this;
    3736
    3837                                var styles = dialog.getContentElement( 'advanced', 'advStyles' );
    3938
     
    4140                                {
    4241                                        styles.on( 'change', function( evt )
    4342                                                {
    44                                                         if ( isUpdating )
    45                                                                 return;
    46 
    47                                                         // Flag to avoid recursion.
    48                                                         isUpdating = 1;
    49 
    5043                                                        // Synchronize width value.
    5144                                                        var width = this.getStyle( 'width', '' ),
    5245                                                                txtWidth = dialog.getContentElement( 'info', 'txtWidth' ),
     
    5952                                                                width = parseInt( width, 10 );
    6053                                                        }
    6154
    62                                                         txtWidth && txtWidth.setValue( width );
    63                                                         cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents' );
     55                                                        txtWidth && txtWidth.setValue( width, true );
     56                                                        cmbWidthType && cmbWidthType.setValue( isPx ? 'pixels' : 'percents', true );
    6457
    6558                                                        // Synchronize height value.
    6659                                                        var height = this.getStyle( 'height', '' ),
    6760                                                                txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
    6861
    6962                                                        height && ( height = parseInt( height, 10 ) );
    70                                                         txtHeight && txtHeight.setValue( height );
    71 
    72                                                         isUpdating = 0;
     63                                                        txtHeight && txtHeight.setValue( height, true );
    7364                                                });
    7465                                }
    7566                        },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy