X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fdialogui%2Fplugin.js;h=c68c35bbef8516817db38a55fea557538c4dd345;hb=f0610347140239143439a511ee2bd48cb784f470;hp=1567c945bae7f5ebde5da2220b047d555054d610;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git diff --git a/_source/plugins/dialogui/plugin.js b/_source/plugins/dialogui/plugin.js index 1567c94..c68c35b 100644 --- a/_source/plugins/dialogui/plugin.js +++ b/_source/plugins/dialogui/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -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; } @@ -117,7 +124,7 @@ CKEDITOR.plugins.add( 'dialogui' ); * @extends CKEDITOR.ui.dialog.uiElement * @param {CKEDITOR.dialog} dialog * Parent dialog object. - * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition + * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition * The element definition. Accepted fields: *