From 560eee72fb532311c17a28a3613073279353ff96 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Tue, 4 Apr 2023 14:38:41 +0800 Subject: [PATCH] add shortcut key prompts to the context menu --- src/main/frontend/components/content.cljs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/frontend/components/content.cljs b/src/main/frontend/components/content.cljs index 47d959d795..06de4a22d7 100644 --- a/src/main/frontend/components/content.cljs +++ b/src/main/frontend/components/content.cljs @@ -44,18 +44,18 @@ {:key "cut" :on-click #(editor-handler/cut-selection-blocks true)} (t :content/cut) - nil) + (ui/keyboard-shortcut-from-config :editor/cut)) (ui/menu-link {:key "delete" :on-click #(do (editor-handler/delete-selection %) (state/hide-custom-context-menu!))} "Delete" - nil) + (ui/keyboard-shortcut-from-config :editor/delete)) (ui/menu-link {:key "copy" :on-click editor-handler/copy-selection-blocks} (t :content/copy) - nil) + (ui/keyboard-shortcut-from-config :editor/copy)) (ui/menu-link {:key "copy as" :on-click (fn [_] @@ -88,7 +88,7 @@ {:key "cycle todos" :on-click editor-handler/cycle-todos!} "Cycle todos" - nil) + (ui/keyboard-shortcut-from-config :editor/cycle-todo)) [:hr.menu-separator] @@ -96,13 +96,13 @@ {:key "Expand all" :on-click editor-handler/expand-all-selection!} "Expand all" - nil) + (ui/keyboard-shortcut-from-config :editor/expand-block-children)) (ui/menu-link {:key "Collapse all" :on-click editor-handler/collapse-all-selection!} "Collapse all" - nil)]) + (ui/keyboard-shortcut-from-config :editor/collapse-block-children))]) (defonce *template-including-parent? (atom nil)) @@ -227,13 +227,13 @@ :on-click (fn [_e] (editor-handler/cut-block! block-id))} (t :content/cut) - nil) + (ui/keyboard-shortcut-from-config :editor/cut)) (ui/menu-link {:key "delete" :on-click #(editor-handler/delete-block-aux! block true)} "Delete" - nil) + (ui/keyboard-shortcut-from-config :editor/delete)) [:hr.menu-separator] @@ -262,14 +262,14 @@ :on-click (fn [_e] (editor-handler/expand-all! block-id))} "Expand all" - nil) + (ui/keyboard-shortcut-from-config :editor/expand-block-children)) (ui/menu-link {:key "Collapse all" :on-click (fn [_e] (editor-handler/collapse-all! block-id {}))} "Collapse all" - nil) + (ui/keyboard-shortcut-from-config :editor/collapse-block-children)) (when (state/sub [:plugin/simple-commands]) (when-let [cmds (state/get-plugins-commands-with-type :block-context-menu-item)]