Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Use indent/outdent commands in list.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Jun 7, 2019
1 parent 12b152d commit b08fee4
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/listediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
}
}
}

Expand Down

0 comments on commit b08fee4

Please sign in to comment.