Ticket #3219: 3219_2.patch

File 3219_2.patch, 5.2 KB (added by Artur Formella, 14 years ago)
  • _source/plugins/dialog/plugin.js

     
    517517                        else
    518518                                return;
    519519
     520                        CKEDITOR.fire( 'beforeDialogOpen', definition );
     521
    520522                        // First, set the dialog to an appropriate size.
    521523                        this.resize( definition.minWidth, definition.minHeight );
    522524
  • _source/plugins/floatpanel/plugin.js

     
    6464                                children : [],
    6565                                dir : editor.lang.dir
    6666                        };
     67                       
     68                        CKEDITOR.on( "beforeDialogOpen" , function()
     69                                {
     70                                        this.hide();
     71                                }, this );
    6772                },
    6873
    6974                proto :
     
    124129                                                display : ''
    125130                                        });
    126131
     132                                // Non IE prefer the event into a window object.
     133                                var focusElement = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );
     134
    127135                                // Configure the IFrame blur event. Do that only once.
    128136                                if ( !this._.blurSet )
    129137                                {
    130                                         // Non IE prefer the event into a window object.
    131                                         var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow );
     138                                        focusElement.on( 'blur', function()
     139                                                {
     140                                                        if ( !this._.panel.allowBlur )
     141                                                                return;
    132142
    133                                         focused.on( 'blur', function()
    134                                                 {
    135143                                                        if ( !this._.activeChild )
    136144                                                                this.hide();
    137145                                                },
    138146                                                this );
    139147
    140                                         focused.on( 'focus', function()
     148                                        focusElement.on( 'focus', function()
    141149                                                {
    142150                                                        this._.focused = true;
    143151                                                        this.hideChild();
     152                                                        this.allowBlur( true );
    144153                                                },
    145154                                                this );
    146155
     
    183192                                                // Set the IFrame focus, so the blur event gets fired.
    184193                                                setTimeout( function()
    185194                                                        {
    186                                                                 iframe.$.contentWindow.focus();
     195                                                                focusElement.focus();
    187196                                                        }, 0);
    188197                                        }, 0);
    189 
    190198                                if ( this.onShow )
    191199                                        this.onShow.call( this );
    192200                        },
    193201
     202                        allowBlur : function( allow )
     203                        {
     204                                this._.panel.allowBlur = allow;
     205                        },
     206
    194207                        hide : function()
    195208                        {
    196209                                if ( !this.onHide || this.onHide.call( this ) !== true )
  • _source/plugins/panel/plugin.js

     
    260260
    261261                hide : function()
    262262                {
    263                         this.element.setStyle( 'display', 'none' );
     263                        if ( !this.onHide || this.onHide.call( this )  !== true )
     264                                this.element.setStyle( 'display', 'none' );
    264265                },
    265266
    266267                onKeyDown : function( keystroke )
  • _source/plugins/panelbutton/plugin.js

     
    8585
    8686                                        this.createPanel( editor );
    8787
     88                                        var panel = _.panel;
     89                                        panel.allowBlur( false );
     90
    8891                                        if ( _.on )
    8992                                        {
    90                                                 _.panel.hide();
     93                                                panel.hide();
    9194                                                return;
    9295                                        }
     96                                        panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 );
    9397
    94                                         _.panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 );
     98                                        if ( !CKEDITOR.env.ie )
     99                                        {
     100                                                setTimeout( function()
     101                                                        {
     102                                                                if (CKEDITOR.env.gecko )
     103                                                                        panel._.iframe.$.focus();                                       // Force blur.
     104                                                                panel.allowBlur( true );
     105                                                        }, 0 );
     106                                        }
     107
    95108                                },
    96109                                this );
    97110                        var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){
     
    210223                                        me.document.getById( _.id ).focus();
    211224                                };
    212225
    213 
    214226                        if ( this.onBlock )
    215227                                this.onBlock( panel, _.id );
     228
     229                        // On block hide.
     230                        panel.getBlock( _.id ).onHide = function()
     231                                {
     232                                        _.on = 0;
     233                                        me.setState( CKEDITOR.TRISTATE_OFF );
     234                                }
    216235                },
    217236
    218237                setState : CKEDITOR.ui.button.prototype.setState
  • _source/plugins/richcombo/plugin.js

     
    9393
    9494                                        this.createPanel( editor );
    9595
     96                                        var panel = _.panel;
     97                                        panel.allowBlur( false );
     98
    9699                                        if ( _.on )
    97100                                        {
    98                                                 _.panel.hide();
     101                                                panel.hide();
    99102                                                return;
    100103                                        }
    101104
     
    111114                                        else
    112115                                                _.list.unmarkAll();
    113116
    114                                         _.panel.showBlock( this.id, new CKEDITOR.dom.element( $element ).getFirst(), 4 );
     117                                        panel.showBlock( this.id, new CKEDITOR.dom.element( $element ).getFirst(), 4 );
     118
     119                                        if ( !CKEDITOR.env.ie )
     120                                        {
     121                                                setTimeout( function()
     122                                                        {
     123                                                                if ( CKEDITOR.env.gecko )
     124                                                                        panel._.iframe.$.focus();                                       // Force blur.
     125                                                                panel.allowBlur( true );
     126                                                        }, 0);
     127                                        }
    115128                                },
    116129                                this );
    117130
     
    264277                        this._.panel = panel;
    265278                        this._.list = list;
    266279
     280                        // On block hide.
     281                        panel.getBlock( this.id ).onHide = function()
     282                                {
     283                                        me._.on = 0;
     284                                        me.setState( CKEDITOR.TRISTATE_OFF );
     285                                }
     286
    267287                        if ( this.init )
    268288                                this.init();
    269289                },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy