Add support for numbered list hotkey

This commit is contained in:
Ilia Ross 2023-10-03 19:04:29 +03:00
parent e087bb718c
commit 2c325b1ee4
No known key found for this signature in database
GPG Key ID: 121E166DD9C821AB

View File

@ -277,6 +277,21 @@ my $html_editor_init_script =
theme: 'snow'
});
// Google Mail like key bind for creating numbered list (Ctrl+Shift+7)
editor.keyboard.addBinding({
key: '7',
shiftKey: true,
ctrlKey: !isMac,
metaKey: isMac,
}, function(range, context) {
const currentFormat = this.quill.getFormat(range.index);
if (currentFormat.list === 'ordered') {
this.quill.format('list', false);
} else {
this.quill.format('list', 'ordered');
}
});
// Google Mail like key bind for creating bullet list (Ctrl+Shift+8)
editor.keyboard.addBinding({
key: '8',