X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fcore%2Fcommand.js;h=f365470a5032aa9ac9a265d132d702d1ddaa18e5;hp=fe64f213a05fdc8d3d40361367d60068df146578;hb=8761695d9b70afe75905deaac88f78c1f8aeb32d;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91 diff --git a/_source/core/command.js b/_source/core/command.js index fe64f21..f365470 100644 --- a/_source/core/command.js +++ b/_source/core/command.js @@ -5,13 +5,15 @@ For licensing, see LICENSE.html or http://ckeditor.com/license CKEDITOR.command = function( editor, commandDefinition ) { + this.uiItems = []; + this.exec = function( data ) { if ( this.state == CKEDITOR.TRISTATE_DISABLED ) return false; - // The editor will always have the focus when executing a command. - editor.focus(); + if( this.editorFocus ) // Give editor focus if necessary (#4355). + editor.focus(); return ( commandDefinition.exec.call( this, editor, data ) !== false ); }; @@ -20,6 +22,7 @@ CKEDITOR.command = function( editor, commandDefinition ) // Defaults { modes : { wysiwyg : 1 }, + editorFocus : true, state : CKEDITOR.TRISTATE_OFF });