Browse Source

Use indent/outdent commands in list.

Maciej Gołaszewski 6 years ago
parent
commit
822628ed70
1 changed files with 17 additions and 2 deletions
  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' ) );
+		}
 	}
 }