From 2c325b1ee41f9b1e2632e8d3750ab89f8ae4fb02 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Tue, 3 Oct 2023 19:04:29 +0300 Subject: [PATCH] Add support for numbered list hotkey --- html-editor-lib.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/html-editor-lib.pl b/html-editor-lib.pl index 9abe0088e..1b4e4b4fd 100644 --- a/html-editor-lib.pl +++ b/html-editor-lib.pl @@ -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',