JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.2.2
[ckeditor.git] / _source / plugins / dialogui / plugin.js
index 1567c94..fc3a7f4 100644 (file)
@@ -87,7 +87,14 @@ CKEDITOR.plugins.add( 'dialogui' );
                                {\r
                                        dialog.on( 'load', function()\r
                                                {\r
-                                                       this.getInputElement().on( 'change', function(){ this.fire( 'change', { value : this.getValue() } ); }, this );\r
+                                                       this.getInputElement().on( 'change', function()\r
+                                                       {\r
+                                                               // Make sure 'onchange' doesn't get fired after dialog closed. (#5719)\r
+                                                               if ( !dialog.parts.dialog.isVisible() )\r
+                                                                       return;\r
+\r
+                                                               this.fire( 'change', { value : this.getValue() } );\r
+                                                       }, this );\r
                                                }, this );\r
                                        this._.domOnChangeRegistered = true;\r
                                }\r
@@ -507,7 +514,7 @@ CKEDITOR.plugins.add( 'dialogui' );
 \r
                                                        element.on( 'keydown', function( evt )\r
                                                                {\r
-                                                                       if ( evt.data.getKeystroke() in { 32:1, 13:1 } )\r
+                                                                       if ( evt.data.getKeystroke() in { 32:1 } )\r
                                                                        {\r
                                                                                me.click();\r
                                                                                evt.data.preventDefault();\r