浏览代码

Use indent/outdent commands in list.

Maciej Gołaszewski 6 年之前
父节点
当前提交
822628ed70
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      packages/ckeditor5-list/src/listediting.js

+ 17 - 2
packages/ckeditor5-list/src/listediting.js

@@ -168,8 +168,23 @@ export default class ListEditing extends Plugin {
 			};
 		};
 
-		this.editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
-		this.editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
+		editor.keystrokes.set( 'Tab', getCommandExecuter( 'indentList' ) );
+		editor.keystrokes.set( 'Shift+Tab', getCommandExecuter( 'outdentList' ) );
+	}
+
+	afterInit() {
+		const commands = this.editor.commands;
+
+		const indent = commands.get( 'indent' );
+		const outdent = commands.get( 'outdent' );
+
+		if ( indent ) {
+			indent.registerChildCommand( commands.get( 'indentList' ) );
+		}
+
+		if ( outdent ) {
+			outdent.registerChildCommand( commands.get( 'outdentList' ) );
+		}
 	}
 }