aboutsummaryrefslogtreecommitdiff
path: root/sources/core/focusmanager.js
diff options
context:
space:
mode:
Diffstat (limited to 'sources/core/focusmanager.js')
-rw-r--r--sources/core/focusmanager.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/sources/core/focusmanager.js b/sources/core/focusmanager.js
index 6fc9969..45c3137 100644
--- a/sources/core/focusmanager.js
+++ b/sources/core/focusmanager.js
@@ -147,34 +147,28 @@
147 * @member CKEDITOR.focusManager 147 * @member CKEDITOR.focusManager
148 */ 148 */
149 blur: function( noDelay ) { 149 blur: function( noDelay ) {
150 if ( this._.locked ) 150 if ( this._.locked ) {
151 return; 151 return;
152 }
152 153
153 function doBlur() { 154 function doBlur() {
154 var editor = this._.editor;
155
156 if ( this.hasFocus ) { 155 if ( this.hasFocus ) {
157 this.hasFocus = false; 156 this.hasFocus = false;
158 157
159 // Blink browsers leave selection in `[contenteditable=true]`
160 // when it's blurred and it's neccessary to remove it manually for inline editor. (#13446)
161 if ( CKEDITOR.env.chrome && editor.editable().isInline() ) {
162 editor.window.$.getSelection().removeAllRanges();
163 }
164
165 var ct = this._.editor.container; 158 var ct = this._.editor.container;
166 ct && ct.removeClass( 'cke_focus' ); 159 ct && ct.removeClass( 'cke_focus' );
167 this._.editor.fire( 'blur' ); 160 this._.editor.fire( 'blur' );
168 } 161 }
169 } 162 }
170 163
171 if ( this._.timer ) 164 if ( this._.timer ) {
172 clearTimeout( this._.timer ); 165 clearTimeout( this._.timer );
166 }
173 167
174 var delay = CKEDITOR.focusManager._.blurDelay; 168 var delay = CKEDITOR.focusManager._.blurDelay;
175 if ( noDelay || !delay ) 169 if ( noDelay || !delay ) {
176 doBlur.call( this ); 170 doBlur.call( this );
177 else { 171 } else {
178 this._.timer = CKEDITOR.tools.setTimeout( function() { 172 this._.timer = CKEDITOR.tools.setTimeout( function() {
179 delete this._.timer; 173 delete this._.timer;
180 doBlur.call( this ); 174 doBlur.call( this );