CKEDITOR.focusManager
Manages the focus activity in an editor instance. This class is to be used mainly by UI element coders when adding interface elements that need to set the focus state of the editor.
var focusManager = new CKEDITOR.focusManager( editor );
focusManager.focus();
Filtering
Properties
currentActive : domObjectCKEDITOR.focusManager#currentActiveIndicates the currently focused DOM element that makes the editor activated.
hasFocus : BooleanCKEDITOR.focusManager#hasFocusIndicates that the editor instance has focus.
alert( CKEDITOR.instances.editor1.focusManager.hasFocus ); // e.g. trueDefaults to
false-
Object used to store private stuff.
Methods
constructor( editor ) → focusManagerCKEDITOR.focusManager#constructorCreates a focusManager class instance.
Parameters
editor : editorThe editor instance.
Returns
focusManager
add( element, isCapture )CKEDITOR.focusManager#addRegisters a UI DOM element to the focus manager, which will make the focus manager "hasFocus" once the input focus is relieved on the element. This method is designed to be used by plugins to expand the jurisdiction of the editor focus.
Parameters
element : elementThe container (topmost) element of one UI part.
isCapture : BooleanIf specified, CKEDITOR.event.useCapture will be used when listening to the focus event.
blur( [ noDelay ] )CKEDITOR.focusManager#blurUsed to indicate that the editor instance has been deactivated by the specified element which has just lost focus.
Note: This function acts asynchronously with a delay of 100ms to avoid temporary deactivation. Use the
noDelayparameter instead to deactivate immediately.var editor = CKEDITOR.instances.editor1; editor.focusManager.blur();Parameters
[ noDelay ] : BooleanImmediately deactivate the editor instance synchronously.
Defaults to
false
focus( [ currentActive ] )CKEDITOR.focusManager#focusIndicates that this editor instance is activated (due to a DOM focus change). The
activatedstate is a symbolic indicator of an active user interaction session.Note: This method will not introduce UI focus impact on DOM, it is here to record the editor UI focus state internally. If you want to make the cursor blink inside the editable, use CKEDITOR.editor.focus instead.
var editor = CKEDITOR.instances.editor1; editor.focusManager.focus( editor.editable() );Parameters
[ currentActive ] : elementThe new value of the currentActive property.
lock()CKEDITOR.focusManager#lockPrevents from changing the focus manager state until the next unlock is called.
remove( element )CKEDITOR.focusManager#removeDismisses an element from the focus manager delegations added by add.
Parameters
element : elementThe element to be removed from the focus manager.
unlock()CKEDITOR.focusManager#unlockRestores the automatic focus management if lock is called.