# HG changeset patch
# User Jude Allred <jude@fogcreek.com>
# Date 1282682442 14400
# Node ID 5dc1d26cb888cdf298e9a0f1c3b4bd45b939a787
# Parent fd322566940c86698a72145f57bc064fb41e979c
Fix a CKEditor bug in Chrome which causes ck.focus() to fail. This now permits inserting items into an unfocused editor. BugzID: 1931507
diff -r fd322566940c -r 5dc1d26cb888 Website/ckeditor/_source/plugins/wysiwygarea/plugin.js
a
|
b
|
|
498 | 498 | blinkCursor(); |
499 | 499 | else if ( CKEDITOR.env.opera ) |
500 | 500 | doc.getBody().focus(); |
501 | | |
| 501 | else if (CKEDITOR.env.webkit) { |
| 502 | //Webkit will fail to focus the contenteditable body if no range is set. |
| 503 | if (editor.getSelection().getRanges().length === 0) { |
| 504 | var selection, range; |
| 505 | range = doc.$.createRange(); |
| 506 | range.selectNodeContents($(doc.$.body).children()[0]); |
| 507 | range.collapse(true); |
| 508 | selection = editor.window.$.getSelection(); |
| 509 | selection.removeAllRanges(); |
| 510 | selection.addRange(range); |
| 511 | } |
| 512 | } |
502 | 513 | |
503 | 514 | editor.focusManager.focus(); |
504 | 515 | }); |