| 1003 | | CKEDITOR.tools.tryThese( |
| 1004 | | function() |
| 1005 | | { |
| 1006 | | editor.document.$.designMode = 'on'; |
| 1007 | | setTimeout( function() |
| 1008 | | { |
| 1009 | | editor.document.$.designMode = 'off'; |
| 1010 | | if ( CKEDITOR.currentInstance == editor ) |
| 1011 | | editor.document.getBody().focus(); |
| 1012 | | }, 50 ); |
| 1013 | | }, |
| 1014 | | function() |
| 1015 | | { |
| 1016 | | // The above call is known to fail when parent DOM |
| 1017 | | // tree layout changes may break design mode. (#5782) |
| 1018 | | // Refresh the 'contentEditable' is a cue to this. |
| 1019 | | editor.document.$.designMode = 'off'; |
| 1020 | | var body = editor.document.getBody(); |
| 1021 | | body.setAttribute( 'contentEditable', false ); |
| 1022 | | body.setAttribute( 'contentEditable', true ); |
| 1023 | | // Try it again once.. |
| 1024 | | !retry && blinkCursor( 1 ); |
| 1025 | | }); |
| | 1003 | // Avoid toggling design mode in an event thread, |
| | 1004 | // which will cause host page scrolling.(#6473) |
| | 1005 | setTimeout( function () |
| | 1006 | { |
| | 1007 | CKEDITOR.tools.tryThese( |
| | 1008 | function() |
| | 1009 | { |
| | 1010 | editor.document.$.designMode = 'on'; |
| | 1011 | setTimeout( function() |
| | 1012 | { |
| | 1013 | editor.document.$.designMode = 'off'; |
| | 1014 | if ( CKEDITOR.currentInstance == editor ) |
| | 1015 | editor.document.getBody().focus(); |
| | 1016 | }, 50 ); |
| | 1017 | }, |
| | 1018 | function() |
| | 1019 | { |
| | 1020 | // The above call is known to fail when parent DOM |
| | 1021 | // tree layout changes may break design mode. (#5782) |
| | 1022 | // Refresh the 'contentEditable' is a cue to this. |
| | 1023 | editor.document.$.designMode = 'off'; |
| | 1024 | var body = editor.document.getBody(); |
| | 1025 | body.setAttribute( 'contentEditable', false ); |
| | 1026 | body.setAttribute( 'contentEditable', true ); |
| | 1027 | // Try it again once.. |
| | 1028 | !retry && blinkCursor( 1 ); |
| | 1029 | }); |
| | 1030 | }, 0 ); |