diff -ENwbur ./cke/plugins/floatpanel/plugin.js ./cke_patch/plugins/floatpanel/plugin.js
old
|
new
|
|
80 | 80 | |
81 | 81 | editor.on( 'mode', hide ); |
82 | 82 | editor.on( 'resize', hide ); |
| 83 | |
83 | 84 | // Window resize doesn't cause hide on blur. (#9800) |
| 85 | // [iOS] Poping up keyboard triggers window resize |
| 86 | // which leads to undesired panel hides |
| 87 | if ( !CKEDITOR.env.iOS ) |
84 | 88 | doc.getWindow().on( 'resize', hide ); |
85 | 89 | |
86 | 90 | // We need a wrapper because events implementation doesn't allow to attach |
… |
… |
|
145 | 149 | // Record from where the focus is when open panel. |
146 | 150 | var editable = this._.editor.editable(); |
147 | 151 | this._.returnFocus = editable.hasFocus ? editable : new CKEDITOR.dom.element( CKEDITOR.document.$.activeElement ); |
| 152 | this._.hideTimeout = 0; |
148 | 153 | |
149 | 154 | var element = this.element, |
150 | 155 | iframe = this._.iframe, |
… |
… |
|
203 | 208 | if ( !this.allowBlur() || ev.data.getPhase() != CKEDITOR.EVENT_PHASE_AT_TARGET ) |
204 | 209 | return; |
205 | 210 | |
206 | | if ( this.visible && !this._.activeChild ) { |
| 211 | if ( this.visible && !this._.activeChild && !this._.hideTimeout ) { |
| 212 | // [iOS] Allow hide to be prevented if touch is bound |
| 213 | // to any parent of the iframe blur happens before touch |
| 214 | this._.hideTimeout = CKEDITOR.tools.setTimeout( function() { |
207 | 215 | // Panel close is caused by user's navigating away the focus, e.g. click outside the panel. |
208 | 216 | // DO NOT restore focus in this case. |
209 | 217 | delete this._.returnFocus; |
210 | 218 | this.hide(); |
| 219 | }, 0, this ); |
211 | 220 | } |
212 | 221 | }, this ); |
213 | 222 | |
… |
… |
|
217 | 226 | this.allowBlur( true ); |
218 | 227 | }, this ); |
219 | 228 | |
| 229 | // [iOS] if touch is bound to any parent of the iframe blur |
| 230 | // happens twice before touchstart and before touchend |
| 231 | if ( CKEDITOR.env.iOS ) { |
| 232 | // Prevent false hiding on blur |
| 233 | // We don't need to return focus here cuz touchend will fire anyway |
| 234 | // If user scrolls and pointer gets out of the panel area touchend will also fire |
| 235 | focused.on( 'touchstart', function() { |
| 236 | clearInterval( this._.hideTimeout ); |
| 237 | }, this); |
| 238 | |
| 239 | // Set focus back to handle blur and hide panel when needed |
| 240 | focused.on( 'touchend', function() { |
| 241 | this._.hideTimeout = 0; |
| 242 | this.focus(); |
| 243 | }, this); |
| 244 | } |
| 245 | |
220 | 246 | CKEDITOR.event.useCapture = false; |
221 | 247 | |
222 | 248 | this._.blurSet = 1; |
diff -ENwbur ./cke/plugins/wysiwygarea/plugin.js ./cke_patch/plugins/wysiwygarea/plugin.js
old
|
new
|
|
264 | 264 | } ); |
265 | 265 | } |
266 | 266 | |
| 267 | if ( CKEDITOR.env.iOS ) { |
| 268 | // [iOS] If touch is bound to any parent of the iframe blur happens on any touch |
| 269 | // event and body becomes the focused element |
| 270 | this.attachListener( doc, 'touchend', function() { |
| 271 | win.focus(); |
| 272 | } ); |
| 273 | } |
| 274 | |
267 | 275 | // ## END |
268 | 276 | |
269 | 277 | |