X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fdialogui%2Fplugin.js;h=7875b5bd604662352486fda21f7f82fee6a7089d;hb=9873d66421922c7aef8be0f5d2ab51e547b19e66;hp=1567c945bae7f5ebde5da2220b047d555054d610;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/dialogui/plugin.js b/_source/plugins/dialogui/plugin.js index 1567c94..7875b5b 100644 --- a/_source/plugins/dialogui/plugin.js +++ b/_source/plugins/dialogui/plugin.js @@ -59,9 +59,9 @@ CKEDITOR.plugins.add( 'dialogui' ); return this.getValue() != this.getInitValue(); }, - reset : function() + reset : function( noChangeEvent ) { - this.setValue( this.getInitValue() ); + this.setValue( this.getInitValue(), noChangeEvent ); }, setInitValue : function() @@ -87,7 +87,14 @@ CKEDITOR.plugins.add( 'dialogui' ); { dialog.on( 'load', function() { - this.getInputElement().on( 'change', function(){ this.fire( 'change', { value : this.getValue() } ); }, this ); + this.getInputElement().on( 'change', function() + { + // Make sure 'onchange' doesn't get fired after dialog closed. (#5719) + if ( !dialog.parts.dialog.isVisible() ) + return; + + this.fire( 'change', { value : this.getValue() } ); + }, this ); }, this ); this._.domOnChangeRegistered = true; } @@ -140,14 +147,15 @@ CKEDITOR.plugins.add( 'dialogui' ); return; var _ = initPrivateObject.call( this, elementDefinition ); - _.labelId = CKEDITOR.tools.getNextNumber() + '_label'; + _.labelId = CKEDITOR.tools.getNextId() + '_label'; var children = this._.children = []; /** @ignore */ var innerHTML = function() { - var html = []; + var html = [], + requiredClass = elementDefinition.required ? ' cke_required' : '' ; if ( elementDefinition.labelLayout != 'horizontal' ) - html.push( '