OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
_backup
/
tinymce
/
tinymce
/
src
/
core
/
main
/
ts
/
focus
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/20/2020 05:44:43 AM
rwxr-xr-x
📄
CefFocus.ts
1.53 KB
02/20/2020 05:43:31 AM
rw-r--r--
📄
EditorFocus.ts
4.06 KB
02/20/2020 05:43:31 AM
rw-r--r--
📄
FocusController.ts
3.86 KB
02/20/2020 05:43:32 AM
rw-r--r--
Editing: CefFocus.ts
Close
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ import { document } from '@ephox/dom-globals'; import { Throttler } from '@ephox/katamari'; import * as CefUtils from '../keyboard/CefUtils'; import Editor from '../api/Editor'; const setup = function (editor: Editor) { const renderFocusCaret = Throttler.first(function () { // AP-24 Added the second condition in this if because of a race condition with setting focus on the PowerPaste // remove/keep formatting dialog on paste in IE11. Without this, because we paste twice on IE11, focus ends up set // in the editor, not the dialog buttons. Specifically, we focus, blur, focus, blur, focus then enter this throttled // code before the next blur has been able to run. With this check, this function doesn't run at all in this case, // so focus goes to the dialog's buttons correctly. if (!editor.removed && editor.getBody().contains(document.activeElement)) { const rng = editor.selection.getRng(); if (rng.collapsed) { // see TINY-1479 const caretRange = CefUtils.renderRangeCaret(editor, editor.selection.getRng(), false); editor.selection.setRng(caretRange); } } }, 0); editor.on('focus', function () { renderFocusCaret.throttle(); }); editor.on('blur', function () { renderFocusCaret.cancel(); }); }; export default { setup };