Ticket #10714: 10714.patch

File 10714.patch, 3.0 KB (added by Arty Gus, 10 years ago)
  • plugins/floatpanel/plugin.js

    diff -ENwbur ./cke/plugins/floatpanel/plugin.js ./cke_patch/plugins/floatpanel/plugin.js
    old new  
    8080
    8181                        editor.on( 'mode', hide );
    8282                        editor.on( 'resize', hide );
     83
    8384                        // 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 )
    8488                        doc.getWindow().on( 'resize', hide );
    8589
    8690                        // We need a wrapper because events implementation doesn't allow to attach
     
    145149                                // Record from where the focus is when open panel.
    146150                                var editable = this._.editor.editable();
    147151                                this._.returnFocus = editable.hasFocus ? editable : new CKEDITOR.dom.element( CKEDITOR.document.$.activeElement );
     152                                this._.hideTimeout = 0;
    148153
    149154                                var element = this.element,
    150155                                        iframe = this._.iframe,
     
    203208                                                if ( !this.allowBlur() || ev.data.getPhase() != CKEDITOR.EVENT_PHASE_AT_TARGET )
    204209                                                        return;
    205210
    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() {
    207215                                                        // Panel close is caused by user's navigating away the focus, e.g. click outside the panel.
    208216                                                        // DO NOT restore focus in this case.
    209217                                                        delete this._.returnFocus;
    210218                                                        this.hide();
     219                                                        }, 0, this );
    211220                                                }
    212221                                        }, this );
    213222
     
    217226                                                this.allowBlur( true );
    218227                                        }, this );
    219228
     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
    220246                                        CKEDITOR.event.useCapture = false;
    221247
    222248                                        this._.blurSet = 1;
  • plugins/wysiwygarea/plugin.js

    diff -ENwbur ./cke/plugins/wysiwygarea/plugin.js ./cke_patch/plugins/wysiwygarea/plugin.js
    old new  
    264264                        } );
    265265                }
    266266
     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
    267275                // ## END
    268276
    269277
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy