| 1285 | // Switch on design mode for a short while and close it after then. |
| 1286 | function blinkCursor( retry ) |
| 1287 | { |
| 1288 | if ( editor.readOnly ) |
| 1289 | return; |
| 1290 | |
| 1291 | CKEDITOR.tools.tryThese( |
| 1292 | function() |
| 1293 | { |
| 1294 | editor.document.$.designMode = 'on'; |
| 1295 | setTimeout( function() |
| 1296 | { |
| 1297 | editor.document.$.designMode = 'off'; |
| 1298 | if ( CKEDITOR.currentInstance == editor ) |
| 1299 | editor.document.getBody().focus(); |
| 1300 | }, 50 ); |
| 1301 | }, |
| 1302 | function() |
| 1303 | { |
| 1304 | // The above call is known to fail when parent DOM |
| 1305 | // tree layout changes may break design mode. (#5782) |
| 1306 | // Refresh the 'contentEditable' is a cue to this. |
| 1307 | editor.document.$.designMode = 'off'; |
| 1308 | var body = editor.document.getBody(); |
| 1309 | body.setAttribute( 'contentEditable', false ); |
| 1310 | body.setAttribute( 'contentEditable', true ); |
| 1311 | // Try it again once.. |
| 1312 | !retry && blinkCursor( 1 ); |
| 1313 | }); |
| 1314 | } |
| 1315 | |