Ticket #4355: 4355.patch

File 4355.patch, 2.6 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/maximize/plugin.js

     
    111111                        editor.addCommand( 'maximize',
    112112                                {
    113113                                        modes : { wysiwyg : 1, source : 1 },
    114 
     114                                        editorFocus : false,
    115115                                        exec : function()
    116116                                        {
    117117                                                var container = editor.container.getChild( [ 0, 0 ] );
  • _source/plugins/scayt/plugin.js

     
    250250        var commandDefinition =
    251251        {
    252252                preserveState : true,
     253                editorFocus : false,
    253254
    254255                exec: function( editor )
    255256                {
  • _source/plugins/showblocks/plugin.js

     
    8989        var commandDefinition =
    9090        {
    9191                preserveState : true,
     92                editorFocus : false,
    9293
    9394                exec : function ( editor )
    9495                {
  • _source/core/commanddefinition.js

     
    7070 *     async : true    // The command need some time to complete after exec function returns.
    7171 * });
    7272 */
     73
     74/**
     75 * Whether the command should give focus to the editor before execution.
     76 * @name  CKEDITOR.commandDefinition.editorFocus
     77 * @type {Boolean}
     78 * @example
     79 * editorInstance.addCommand( 'maximize',
     80 * {
     81 *     exec : function( editor )
     82 *     {
     83 *     },
     84 *     editorFocus : false    // The command doesn't require focusing the editing document.
     85 * });
     86 */
  • _source/core/command.js

     
    1212                if ( this.state == CKEDITOR.TRISTATE_DISABLED )
    1313                        return false;
    1414
    15                 // The editor will always have the focus when executing a command.
    16                 editor.focus();
     15                if( commandDefinition.editorFocus )     // Give editor focus if necessary.
     16                        editor.focus();
    1717
    1818                return ( commandDefinition.exec.call( this, editor, data ) !== false );
    1919        };
     
    2222                // Defaults
    2323                {
    2424                        modes : { wysiwyg : 1 },
     25                        editorFocus : true,
    2526                        state : CKEDITOR.TRISTATE_OFF
    2627                });
    2728
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy