浏览代码

The IndentCommand could return nodes that were modified.

Kamil Piechaczek 5 年之前
父节点
当前提交
5a3e3072e5
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      packages/ckeditor5-list/src/indentcommand.js

+ 3 - 1
packages/ckeditor5-list/src/indentcommand.js

@@ -53,7 +53,7 @@ export default class IndentCommand extends Command {
 		const doc = model.document;
 		let itemsToChange = Array.from( doc.selection.getSelectedBlocks() );
 
-		model.change( writer => {
+		return model.change( writer => {
 			const lastItem = itemsToChange[ itemsToChange.length - 1 ];
 
 			// Indenting a list item should also indent all the items that are already sub-items of indented item.
@@ -90,6 +90,8 @@ export default class IndentCommand extends Command {
 					writer.setAttribute( 'listIndent', indent, item );
 				}
 			}
+
+			return itemsToChange;
 		} );
 	}