JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.0.1
[ckeditor.git] / _source / core / command.js
index fe64f21..f365470 100644 (file)
@@ -5,13 +5,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
 \r
 CKEDITOR.command = function( editor, commandDefinition )\r
 {\r
+       this.uiItems = [];\r
+\r
        this.exec = function( data )\r
        {\r
                if ( this.state == CKEDITOR.TRISTATE_DISABLED )\r
                        return false;\r
 \r
-               // The editor will always have the focus when executing a command.\r
-               editor.focus();\r
+               if( this.editorFocus )     // Give editor focus if necessary (#4355).\r
+                       editor.focus();\r
 \r
                return ( commandDefinition.exec.call( this, editor, data ) !== false );\r
        };\r
@@ -20,6 +22,7 @@ CKEDITOR.command = function( editor, commandDefinition )
                // Defaults\r
                {\r
                        modes : { wysiwyg : 1 },\r
+                       editorFocus : true,\r
                        state : CKEDITOR.TRISTATE_OFF\r
                });\r
 \r