Ticket #6137: 6137_2.patch
File 6137_2.patch, 5.0 KB (added by , 14 years ago) |
---|
-
_source/plugins/dialogui/plugin.js
61 61 62 62 reset : function() 63 63 { 64 this.setValue( this.getInitValue() ); 64 // Suppress 'change' event during resetting. 65 this.setValue( this.getInitValue(), true ); 65 66 }, 66 67 67 68 setInitValue : function() … … 1061 1062 setValue : function( value ) 1062 1063 { 1063 1064 !value && ( value = '' ); 1064 return CKEDITOR.ui.dialog.uiElement.prototype.setValue. call( this, value);1065 return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply( this, arguments ); 1065 1066 }, 1066 1067 1067 1068 keyboardFocusable : true … … 1156 1157 * Sets the state of the checkbox. 1157 1158 * @example 1158 1159 * @param {Boolean} true to tick the checkbox, false to untick it. 1160 * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. 1159 1161 */ 1160 setValue : function( checked )1162 setValue : function( checked, noChangeEvent ) 1161 1163 { 1162 1164 this.getInputElement().$.checked = checked; 1163 this.fire( 'change', { value : checked } );1165 !noChangeEvent && this.fire( 'change', { value : checked } ); 1164 1166 }, 1165 1167 1166 1168 /** … … 1222 1224 * Checks one of the radio buttons in this button group. 1223 1225 * @example 1224 1226 * @param {String} value The value of the button to be chcked. 1227 * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. 1225 1228 */ 1226 setValue : function( value )1229 setValue : function( value, noChangeEvent ) 1227 1230 { 1228 1231 var children = this._.children, 1229 1232 item; 1230 1233 for ( var i = 0 ; ( i < children.length ) && ( item = children[i] ) ; i++ ) 1231 1234 item.getElement().$.checked = ( item.getValue() == value ); 1232 this.fire( 'change', { value : value } );1235 !noChangeEvent && this.fire( 'change', { value : value } ); 1233 1236 }, 1234 1237 1235 1238 /** -
_source/plugins/dialog/plugin.js
2354 2354 /** 2355 2355 * Sets the value of this dialog UI object. 2356 2356 * @param {Object} value The new value. 2357 * @param {Boolean} noChangeEvent Internal commit, to supress 'change' event on this element. 2357 2358 * @returns {CKEDITOR.dialog.uiElement} The current UI element. 2358 2359 * @example 2359 2360 * uiElement.setValue( 'Dingo' ); 2360 2361 */ 2361 setValue : function( value )2362 setValue : function( value, noChangeEvent ) 2362 2363 { 2363 2364 this.getInputElement().setValue( value ); 2364 this.fire( 'change', { value : value } );2365 !noChangeEvent && this.fire( 'change', { value : value } ); 2365 2366 return this; 2366 2367 }, 2367 2368 -
_source/plugins/table/dialogs/table.js
32 32 33 33 onLoad : function() 34 34 { 35 var dialog = this, 36 isUpdating; 35 var dialog = this; 37 36 38 37 var styles = dialog.getContentElement( 'advanced', 'advStyles' ); 39 38 … … 41 40 { 42 41 styles.on( 'change', function( evt ) 43 42 { 44 if ( isUpdating )45 return;46 47 // Flag to avoid recursion.48 isUpdating = 1;49 50 43 // Synchronize width value. 51 44 var width = this.getStyle( 'width', '' ), 52 45 txtWidth = dialog.getContentElement( 'info', 'txtWidth' ), … … 59 52 width = parseInt( width, 10 ); 60 53 } 61 54 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 ); 64 57 65 58 // Synchronize height value. 66 59 var height = this.getStyle( 'height', '' ), 67 60 txtHeight = dialog.getContentElement( 'info', 'txtHeight' ); 68 61 69 62 height && ( height = parseInt( height, 10 ) ); 70 txtHeight && txtHeight.setValue( height ); 71 72 isUpdating = 0; 63 txtHeight && txtHeight.setValue( height, true ); 73 64 }); 74 65 } 75 66 }, -
_source/plugins/dialogadvtab/plugin.js
43 43 } 44 44 } 45 45 46 var isUpdating;47 48 46 CKEDITOR.plugins.add( 'dialogadvtab', 49 47 { 50 48 /** … … 144 142 145 143 updateStyle : function( name, value ) 146 144 { 147 if ( isUpdating )148 return;149 150 // Flag to avoid recursion.151 isUpdating = 1;152 153 145 var styles = this.getValue(); 154 146 155 147 // Remove the current value. … … 167 159 styles += name + ': ' + value; 168 160 } 169 161 170 this.setValue( styles );162 this.setValue( styles, true ); 171 163 172 isUpdating = 0;173 164 }, 174 165 175 166 setup : setupAdvParams,