Ticket #3716: 3716_2.patch

File 3716_2.patch, 2.9 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/floatpanel/plugin.js

     
    128128                                                display : ''
    129129                                        });
    130130
     131                                // Non IE prefer the event into a window object.
     132                                var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );
     133
    131134                                // Configure the IFrame blur event. Do that only once.
    132                                 if ( !this._.blurSet )
     135                                if ( !focused.getCustomData( 'blurSet' ) )
    133136                                {
    134                                         // Non IE prefer the event into a window object.
    135                                         var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );
    136 
    137137                                        focused.on( 'blur', function()
    138138                                                {
    139                                                         if ( !this._.activeChild && !isShowing )
     139                                                        if ( !iframe.getCustomData( 'activeChild' ) && !isShowing )
    140140                                                                this.hide();
    141141                                                },
    142142                                                this );
    143143
    144144                                        focused.on( 'focus', function()
    145145                                                {
    146                                                         this._.focused = true;
     146                                                        iframe.setCustomData( 'focused', true );
    147147                                                        this.hideChild();
    148148                                                },
    149149                                                this );
    150150
    151                                         this._.blurSet = 1;
     151                                        focused.setCustomData( 'blurSet', true );
    152152                                }
    153153
    154154                                panel.onEscape = CKEDITOR.tools.bind( function()
     
    232232
    233233                        hide : function()
    234234                        {
    235                                 if ( !this.onHide || this.onHide.call( this ) !== true )
     235                                var onHide = this._.iframe.getCustomData( 'onHide' );
     236
     237                                if ( !onHide || onHide.call( this ) !== true )
    236238                                {
    237239                                        this.hideChild();
    238240                                        this.element.setStyle( 'display', 'none' );
     
    241243
    242244                        showAsChild : function( panel, blockName, offsetParent, corner, offsetX, offsetY )
    243245                        {
     246                                var iframe = this._.iframe;
     247
    244248                                this.hideChild();
    245249
    246                                 panel.onHide = CKEDITOR.tools.bind( function()
     250                                panel._.iframe.setCustomData( 'onHide', CKEDITOR.tools.bind( function()
    247251                                        {
    248252                                                // Use a timeout, so we give time for this menu to get
    249253                                                // potentially focused.
    250254                                                CKEDITOR.tools.setTimeout( function()
    251255                                                        {
    252                                                                 if ( !this._.focused )
     256                                                                if ( !iframe.getCustomData( 'focused' ) )
    253257                                                                        this.hide();
    254258                                                        },
    255259                                                        0, this );
    256260                                        },
    257                                         this );
     261                                        this ) );
    258262
    259                                 this._.activeChild = panel;
    260                                 this._.focused = false;
     263                                iframe.setCustomData( 'activeChild', panel );
     264                                iframe.removeCustomData( 'focused' );
    261265
    262266                                panel.showBlock( blockName, offsetParent, corner, offsetX, offsetY );
    263267                        },
    264268
    265269                        hideChild : function()
    266270                        {
    267                                 var activeChild = this._.activeChild;
     271                                var iframe = this._.iframe;
     272                                var activeChild = iframe.getCustomData( 'activeChild' );
    268273
    269274                                if ( activeChild )
    270275                                {
    271                                         delete activeChild.onHide;
    272                                         delete this._.activeChild;
     276                                        activeChild._.iframe.removeCustomData( 'onHide' );
     277                                        iframe.removeCustomData( 'activeChild' );
    273278                                        activeChild.hide();
    274279                                }
    275280                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy