Ticket #3988: 3988.patch
File 3988.patch, 2.9 KB (added by , 15 years ago) |
---|
-
_source/core/editor.js
283 283 var form = element.$.form && new CKEDITOR.dom.element( element.$.form ); 284 284 if ( form ) 285 285 { 286 form.on( 'submit', function() 287 { 288 editor.updateElement(); 289 }); 286 function onSubmit() 287 { 288 editor.updateElement(); 289 } 290 form.on( 'submit',onSubmit ); 290 291 291 292 // Setup the submit function because it doesn't fire the 292 293 // "submit" event. 293 294 if ( !form.$.submit.nodeName ) 294 295 { 295 f orm.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit )296 297 298 299 296 function submitHandler( originalSubmit ) 297 { 298 return function() 299 { 300 editor.updateElement(); 300 301 301 // For IE, the DOM submit function is not a 302 // function, so we need thid check. 303 if ( originalSubmit.apply ) 304 originalSubmit.apply( this, arguments ); 305 else 306 originalSubmit(); 307 }; 308 }); 309 } 310 } 311 } 302 // For IE, the DOM submit function is not a 303 // function, so we need thid check. 304 if ( originalSubmit.apply ) 305 originalSubmit.apply( this, arguments ); 306 else 307 originalSubmit(); 308 }; 309 } 310 311 var originalSubmit = form.$.submit; 312 form.$.submit = CKEDITOR.tools.override( form.$.submit, submitHandler ); 313 } 314 315 // Remove all 'submit' events registered on form element before destroying.(#3988) 316 editor.on( 'beforeDestroy', function() 317 { 318 form.removeListener( 'submit', onSubmit ); 319 if ( originalSubmit ) 320 form.$.submit = originalSubmit; 321 } ); 322 } 323 } 312 324 }; 313 325 314 326 function updateCommandsMode() … … 447 459 */ 448 460 destroy : function( noUpdate ) 449 461 { 462 this.fire( 'beforeDestroy' ); 450 463 if ( !noUpdate ) 451 464 this.updateElement(); 452 453 465 this.theme.destroy( this ); 454 466 CKEDITOR.remove( this ); 455 467 }, -
CHANGES.html
153 153 <li><a href="http://dev.fckeditor.net/ticket/3793">#3793</a> : Combined images into sprites.</li> 154 154 <li><a href="http://dev.fckeditor.net/ticket/3783">#3783</a> : Fixed indenting command in table cells create collapsed paragraph.</li> 155 155 <li><a href="http://dev.fckeditor.net/ticket/3968">#3968</a> : About dialog layout was broken with IE+Standards+RTL.</li> 156 <li><a href="http://dev.fckeditor.net/ticket/3988">#3988</a> : Destroy editor on form submit event cause error.</li> 156 157 </ul> 157 158 <h3> 158 159 CKEditor 3.0 RC</h3>