]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7689 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Tue, 12 Aug 2025 09:26:32 +0000 (11:26 +0200)
committersoufiane <soufiane@cubedesigners.com>
Tue, 12 Aug 2025 09:26:32 +0000 (11:26 +0200)
resources/markdowneditor/js/markdowneditor.js
resources/markdowneditor/js/markdowneditor.toolbar.js
resources/views/fluidbook_publication/markdown_editor.blade.php

index 692002634151706ecdc63cafcf556a88f90a3eb3..dc918650ba4c5a25f5c20c73638108b90a1e2f44 100644 (file)
@@ -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();
     },
 
index 8c2eb1a06176d5b1148b3ff02d7c6aa8d4723ec9..8c8fe5ec904ec33e3a522dd16bed920b4aea6b61 100644 (file)
@@ -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);
index 8a4d3408fb0b151d954ef0e3cf59f727867f0c51..a56b0c1b4ed46ebdc25092c41b6364cd6745e0af 100644 (file)
@@ -88,7 +88,7 @@
                 <nav class="markdown-toolbar-left" id="markdown-toolbar-left">
                     <div class="markdown-toolbar-save-block">
                         <a href="#" data-icon="save" data-action="save.save" data-tooltip="{{__('Sauvegarder')}} (Ctrl+S)"
-                           data-key="ctrl+s"></a>
+                           ></a>
                         <a nohref data-icon="loading" class=""></a>
                     </div>
                     <a href="#" data-icon="undo" data-action="undo.undo"