Browse Source

improve(ux): add delete option for blocks context menu

charlie 2 years ago
parent
commit
86b5c9dc77
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/main/frontend/components/content.cljs

+ 12 - 0
src/main/frontend/components/content.cljs

@@ -35,6 +35,12 @@
      :on-click #(editor-handler/cut-selection-blocks true)}
     "Cut"
     nil)
+   (ui/menu-link
+    {:key      "delete"
+     :on-click #(do (editor-handler/delete-selection %)
+                    (state/hide-custom-context-menu!))}
+    "Delete"
+    nil)
    (ui/menu-link
     {:key "copy"
      :on-click editor-handler/copy-selection-blocks}
@@ -232,6 +238,12 @@
           "Cut"
           nil)
 
+         (ui/menu-link
+          {:key      "delete"
+           :on-click #(editor-handler/delete-block-aux! block true)}
+          "Delete"
+          nil)
+
          [:hr.menu-separator]
 
          (block-template block-id)