From b08fee420141e135178eb741ed7bf71005493e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Go=C5=82aszewski?= Date: Fri, 7 Jun 2019 15:42:05 +0200 Subject: [PATCH] Use indent/outdent commands in list. --- src/listediting.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/listediting.js b/src/listediting.js index a1e7208..51c0387 100644 --- a/src/listediting.js +++ b/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' ) ); + } } }