From 96fd773eed695098444a1d6c9fb7b3ac999b3dee Mon Sep 17 00:00:00 2001 From: soufiane Date: Tue, 12 Aug 2025 11:26:32 +0200 Subject: [PATCH] wait #7689 @0:30 --- resources/markdowneditor/js/markdowneditor.js | 12 ++++++++++-- .../markdowneditor/js/markdowneditor.toolbar.js | 3 ++- .../fluidbook_publication/markdown_editor.blade.php | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/resources/markdowneditor/js/markdowneditor.js b/resources/markdowneditor/js/markdowneditor.js index 692002634..dc918650b 100644 --- a/resources/markdowneditor/js/markdowneditor.js +++ b/resources/markdowneditor/js/markdowneditor.js @@ -76,6 +76,15 @@ MarkdownEditor.prototype = { } }); + document.addEventListener("keydown", function(event) { + if (event.ctrlKey && event.key === "s") { + event.preventDefault(); + event.stopPropagation(); + + $this.save.save() + } + }, true); + $(window).on('hashchange', function () { /*if ($this.maskHashEvent) { return; @@ -221,10 +230,9 @@ MarkdownEditor.prototype = { ['hr', 'quote'], ['ul'], ['table', 'image', 'link'], - ['scrollSync'] + ['scrollSync'], ] }); - this.editor.getMarkdown(); }, diff --git a/resources/markdowneditor/js/markdowneditor.toolbar.js b/resources/markdowneditor/js/markdowneditor.toolbar.js index 8c2eb1a06..8c8fe5ec9 100644 --- a/resources/markdowneditor/js/markdowneditor.toolbar.js +++ b/resources/markdowneditor/js/markdowneditor.toolbar.js @@ -20,12 +20,13 @@ MarkdowneditorToolbar.prototype = { $("[data-key]").each(function () { let e = $(this); - key($(this).data('key'), function () { + key($(this).data('key'), function (event) { if ($(e).is('[data-key-skipintextfields]') && $this.markdowneditor.isfocusOnFormItem()) { return true; } $(e).addClass('hover'); $this.markdowneditor.runAction($(e).data('action')); + setTimeout(function () { $(e).removeClass('hover') }, 150); diff --git a/resources/views/fluidbook_publication/markdown_editor.blade.php b/resources/views/fluidbook_publication/markdown_editor.blade.php index 8a4d3408f..a56b0c1b4 100644 --- a/resources/views/fluidbook_publication/markdown_editor.blade.php +++ b/resources/views/fluidbook_publication/markdown_editor.blade.php @@ -88,7 +88,7 @@