Ticket #3068: 3068_2.patch

File 3068_2.patch, 4.6 KB (added by Artur Formella, 15 years ago)
  • plugins/floatpanel/plugin.js

     
    6464                                children : [],
    6565                                dir : editor.lang.dir
    6666                        };
     67
     68                        var me = this;
     69
     70                        // If the "contextmenu" plugin is loaded, register the listener.
     71                        if ( editor.contextMenu )
     72                        {
     73                                editor.contextMenu.addListener( function()
     74                                        {
     75                                                me.hide();
     76                                        });
     77                        }
     78                        editor.on( 'beforeCommandExec', function()
     79                                {
     80                                        me.hide();
     81                                });
    6782                },
    6883
    6984                proto :
     
    124139                                                display : ''
    125140                                        });
    126141
     142                                if ( this.onShow )
     143                                        this.onShow.call( this );
     144
    127145                                // Configure the IFrame blur event. Do that only once.
    128146                                if ( !this._.blurSet )
    129147                                {
     
    132150
    133151                                        focused.on( 'blur', function()
    134152                                                {
     153                                                        if ( !this._.panel.allowBlur )
     154                                                                return;
     155
    135156                                                        if ( !this._.activeChild )
    136157                                                                this.hide();
    137158                                                },
     
    141162                                                {
    142163                                                        this._.focused = true;
    143164                                                        this.hideChild();
     165                                                        this.allowBlur( true );
    144166                                                },
    145167                                                this );
    146168
     
    186208                                                                iframe.$.contentWindow.focus();
    187209                                                        }, 0);
    188210                                        }, 0);
     211                        },
    189212
    190                                 if ( this.onShow )
    191                                         this.onShow.call( this );
     213                        allowBlur : function( allow )
     214                        {
     215                                this._.panel.allowBlur = allow;
    192216                        },
    193217
    194218                        hide : function()
  • plugins/panel/plugin.js

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

     
    8484                                                return;
    8585
    8686                                        this.createPanel( editor );
     87                                        var panel = _.panel;
     88                                        panel.allowBlur( false );
    8789
    8890                                        if ( _.on )
    8991                                        {
    90                                                 _.panel.hide();
     92                                                panel.hide();
    9193                                                return;
    9294                                        }
    93 
    94                                         _.panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 );
     95                                        panel.showBlock( this._.id, new CKEDITOR.dom.element( $element ), 4 );
     96                                        setTimeout( function()
     97                                                {
     98                                                        if ( CKEDITOR.env.gecko )
     99                                                                panel._.iframe.$.focus();                                       // Force blur.
     100                                                        panel.allowBlur( true );
     101                                                }, 0 );
    95102                                },
    96103                                this );
    97104                        var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ){
     
    210217                                        me.document.getById( _.id ).focus();
    211218                                };
    212219
    213 
    214220                        if ( this.onBlock )
    215221                                this.onBlock( panel, _.id );
     222
     223                        panel.getBlock( _.id ).onHide = function()
     224                                {
     225                                        _.on = 0;
     226                                        me.setState( CKEDITOR.TRISTATE_OFF );
     227                                }
    216228                },
    217229
    218230                setState : CKEDITOR.ui.button.prototype.setState
  • 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                                        setTimeout( function()
     120                                                {
     121                                                        if (CKEDITOR.env.gecko )
     122                                                                panel._.iframe.$.focus();                                       // Force blur.
     123                                                        panel.allowBlur( true );
     124                                                }, 0 );
    115125                                },
    116126                                this );
    117127
     
    264274                        this._.panel = panel;
    265275                        this._.list = list;
    266276
     277                        panel.getBlock( this.id ).onHide = function()
     278                                {
     279                                        me._.on = 0;
     280                                        me.setState( CKEDITOR.TRISTATE_OFF );
     281                                }
     282
    267283                        if ( this.init )
    268284                                this.init();
    269285                },
  • plugins/stylescombo/plugin.js

     
    149149
    150150                                        onOpen : function()
    151151                                        {
    152                                                 editor.focus();
     152                                                if ( CKEDITOR.env.ie )
     153                                                        editor.focus();
    153154
    154155                                                var selection = editor.getSelection();
    155156
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy