X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fcore%2Fcommand.js;h=0a8d0988635a2d77f0172d73da18a13dfef32f32;hb=c6e377a02b54abc07129d72b632763c727476a15;hp=fe64f213a05fdc8d3d40361367d60068df146578;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/core/command.js b/_source/core/command.js index fe64f21..0a8d098 100644 --- a/_source/core/command.js +++ b/_source/core/command.js @@ -1,17 +1,19 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 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 });