* @member CKEDITOR.focusManager
*/
blur: function( noDelay ) {
- if ( this._.locked )
+ if ( this._.locked ) {
return;
+ }
function doBlur() {
- var editor = this._.editor;
-
if ( this.hasFocus ) {
this.hasFocus = false;
- // Blink browsers leave selection in `[contenteditable=true]`
- // when it's blurred and it's neccessary to remove it manually for inline editor. (#13446)
- if ( CKEDITOR.env.chrome && editor.editable().isInline() ) {
- editor.window.$.getSelection().removeAllRanges();
- }
-
var ct = this._.editor.container;
ct && ct.removeClass( 'cke_focus' );
this._.editor.fire( 'blur' );
}
}
- if ( this._.timer )
+ if ( this._.timer ) {
clearTimeout( this._.timer );
+ }
var delay = CKEDITOR.focusManager._.blurDelay;
- if ( noDelay || !delay )
+ if ( noDelay || !delay ) {
doBlur.call( this );
- else {
+ } else {
this._.timer = CKEDITOR.tools.setTimeout( function() {
delete this._.timer;
doBlur.call( this );