| 414 | // Standard compliant IE doesn't focus the editor while |
| 415 | // clicking outside actual content in editing frame. (#1659) |
| 416 | if( CKEDITOR.env.ie |
| 417 | && domDocument.$.compatMode == 'CSS1Compat' ) |
| 418 | { |
| 419 | domDocument.on( 'mousedown', function( evt ) |
| 420 | { |
| 421 | var htmlElement = domDocument.getDocumentElement(), |
| 422 | domEvent = evt.data.$, |
| 423 | target = evt.data.getTarget(), |
| 424 | offsetX= domEvent.offsetX, |
| 425 | offsetY = domEvent.offsetY, |
| 426 | docWidth = htmlElement.$.clientWidth, |
| 427 | docHeight = htmlElement.$.clientHeight; |
| 428 | |
| 429 | // Focus the editor if: |
| 430 | // 1. Not in <body> |
| 431 | // 2. Not on scroll-bars. |
| 432 | if ( !( editor.focusManager.hasFocus |
| 433 | || !offsetX || !offsetY |
| 434 | || offsetX < 0 || offsetX > docWidth |
| 435 | || offsetY > docHeight |
| 436 | || target.getAscendant( 'body', true) ) ) |
| 437 | // Avoid focus the editor directly otherwise |
| 438 | // the cursor is not blinking. |
| 439 | editor.container.focus(); |
| 440 | } ); |
| 441 | } |
| 442 | |