浏览代码

Don\'t apply ParagraphCommand if already applied.

Aleksander Nowodzinski 8 年之前
父节点
当前提交
11193252d0
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      packages/ckeditor5-paragraph/src/paragraphcommand.js

+ 4 - 0
packages/ckeditor5-paragraph/src/paragraphcommand.js

@@ -58,6 +58,10 @@ export default class ParagraphCommand extends Command {
 	 * By default, if not provided, the command is applied to current {@link module:engine/model/document~Document#selection}.
 	 */
 	_doExecute( options = {} ) {
+		if ( this.value && !options.element ) {
+			return;
+		}
+
 		const document = this.editor.document;
 
 		document.enqueueChanges( () => {