From 099855d8fbdfcc2da21d9002fef51f2797571626 Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Mon, 14 Oct 2013 14:46:27 +0200 Subject: [PATCH 1/3] Fix problem with cursor not appearing in IE11 when clicking below the body. --- plugins/wysiwygarea/plugin.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index bd7fb1fb13a..f1579f5ad2a 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -179,12 +179,20 @@ } }, 0 ); } - }); - } else if ( CKEDITOR.env.webkit ) { - // Fix problem with cursor not appearing in Chrome when clicking below the body (#10945). + } ); + } + + // Fix problem with cursor not appearing in Chrome and IE11 when clicking below the body (#10945, #10906). + if ( CKEDITOR.env.webkit || ( CKEDITOR.env.ie && CKEDITOR.env.version > 10 ) ) { doc.getDocumentElement().on( 'mousedown', function( evt ) { - if ( evt.data.getTarget().is( 'html' ) ) - editor.editable().focus(); + if ( evt.data.getTarget().is( 'html' ) ) { + if ( CKEDITOR.env.ie ) { + setTimeout( function() { + editor.editable().focus(); + }, 0 ); + } else + editor.editable().focus(); + } } ); } From fdcda5b69dca07aeaca4af03ead9d8357c32b93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Wed, 30 Oct 2013 17:46:56 +0100 Subject: [PATCH 2/3] Avoid unnecessary code branching. --- plugins/wysiwygarea/plugin.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index f1579f5ad2a..df52f28726f 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -186,12 +186,10 @@ if ( CKEDITOR.env.webkit || ( CKEDITOR.env.ie && CKEDITOR.env.version > 10 ) ) { doc.getDocumentElement().on( 'mousedown', function( evt ) { if ( evt.data.getTarget().is( 'html' ) ) { - if ( CKEDITOR.env.ie ) { - setTimeout( function() { - editor.editable().focus(); - }, 0 ); - } else + // IE needs this timeout. Webkit does not, but it does not cause problems too. + setTimeout( function() { editor.editable().focus(); + } ); } } ); } From d08ecca1c5ebc667f1fba49cea57d24d35d16566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotrek=20Reinmar=20Koszuli=C5=84ski?= Date: Wed, 30 Oct 2013 17:47:41 +0100 Subject: [PATCH 3/3] Clarified code with a comment. --- plugins/wysiwygarea/plugin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/wysiwygarea/plugin.js b/plugins/wysiwygarea/plugin.js index df52f28726f..95a221eac72 100644 --- a/plugins/wysiwygarea/plugin.js +++ b/plugins/wysiwygarea/plugin.js @@ -182,7 +182,8 @@ } ); } - // Fix problem with cursor not appearing in Chrome and IE11 when clicking below the body (#10945, #10906). + // Fix problem with cursor not appearing in Webkit and IE11+ when clicking below the body (#10945, #10906). + // Fix for older IEs (8-10 and QM) is placed inside selection.js. if ( CKEDITOR.env.webkit || ( CKEDITOR.env.ie && CKEDITOR.env.version > 10 ) ) { doc.getDocumentElement().on( 'mousedown', function( evt ) { if ( evt.data.getTarget().is( 'html' ) ) {