File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ CKEditor 4 Changelog
4
4
## CKEditor 4.1.1
5
5
6
6
* [ #10172 ] ( http://dev.ckeditor.com/ticket/10172 ) : Pressing delete/backspace in empty table cell moves cursor to next/previous cell.
7
+ * [ #10219 ] ( http://dev.ckeditor.com/ticket/10219 ) : Error thrown when destroying an instance in parallel with a mouseup event.
7
8
8
9
## CKEditor 4.1
9
10
Original file line number Diff line number Diff line change 477
477
! preventBeforePasteEvent && fixCut ( editor ) ;
478
478
} ) ;
479
479
480
+ var mouseupTimeout ;
481
+
480
482
// Use editor.document instead of editable in non-IEs for observing mouseup
481
483
// since editable won't fire the event if selection process started within
482
484
// iframe and ended out of the editor (#9851).
483
485
editable . attachListener ( CKEDITOR . env . ie ? editable : editor . document . getDocumentElement ( ) , 'mouseup' , function ( ) {
484
- setTimeout ( function ( ) {
486
+ mouseupTimeout = setTimeout ( function ( ) {
485
487
setToolbarStates ( ) ;
486
488
} , 0 ) ;
487
489
} ) ;
488
490
491
+ // Make sure that deferred mouseup callback isn't executed after editor instance
492
+ // had been destroyed. This may happen when editor.destroy() is called in parallel
493
+ // with mouseup event (i.e. a button with onclick callback) (#10219).
494
+ editor . on ( 'destroy' , function ( ) {
495
+ clearTimeout ( mouseupTimeout ) ;
496
+ } ) ;
497
+
489
498
editable . on ( 'keyup' , setToolbarStates ) ;
490
499
}
491
500
You can’t perform that action at this time.
0 commit comments