Ticket #3068: 3068_3.patch

File 3068_3.patch, 1.9 KB (added by Frederico Caldeira Knabben, 15 years ago)
  • _source/core/dom/domobject.js

     
    8585                                var listener = nativeListeners[ eventName ] = getNativeListener( this, eventName );
    8686
    8787                                if ( this.$.addEventListener )
    88                                         this.$.addEventListener( eventName, listener, false );
     88                                        this.$.addEventListener( eventName, listener, !!CKEDITOR.event.useCapture );
    8989                                else if ( this.$.attachEvent )
    9090                                        this.$.attachEvent( 'on' + eventName, listener );
    9191                        }
  • _source/plugins/floatpanel/plugin.js

     
    130130                                        // Non IE prefer the event into a window object.
    131131                                        var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );
    132132
    133                                         focused.on( 'blur', function()
     133                                        // With addEventListener compatible browsers, we must
     134                                        // useCapture when registering the focus/blur events to
     135                                        // guarantee they will be firing in all situations. (#3068)
     136                                        CKEDITOR.event.useCapture = true;
     137
     138                                        focused.on( 'blur', function( ev )
    134139                                                {
     140                                                        // As we are using capture to register the listener,
     141                                                        // the blur event may get fired even when focusing
     142                                                        // inside the window itself, so we must ensure the
     143                                                        // target is out of it.
     144                                                        var target = ev.data.getTarget(),
     145                                                                targetWindow = target.getWindow && target.getWindow();
     146
     147                                                        if ( targetWindow && targetWindow.equals( focused ) )
     148                                                                return;
     149
    135150                                                        if ( !this._.activeChild )
    136151                                                                this.hide();
    137152                                                },
     
    144159                                                },
    145160                                                this );
    146161
     162                                        CKEDITOR.event.useCapture = false;
     163
    147164                                        this._.blurSet = 1;
    148165                                }
    149166
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy