X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fdialogui%2Fplugin.js;h=319af7c4cdc2af01cb344f13b99afe0375a1e11b;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=1567c945bae7f5ebde5da2220b047d555054d610;hpb=059b4c2fef02528bf1af189f7996e80652faddfb;p=ckeditor.git
diff --git a/_source/plugins/dialogui/plugin.js b/_source/plugins/dialogui/plugin.js
index 1567c94..319af7c 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:
*
* - label (Required) The label string.
@@ -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( '