瀏覽代碼

fix: can't copy && paste multiple blocks

Tienson Qin 4 年之前
父節點
當前提交
a8703c2ea5
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/main/frontend/components/content.cljs

+ 4 - 4
src/main/frontend/components/content.cljs

@@ -246,25 +246,25 @@
                       (let [target (gobj/get e "target")
                             block-id (d/attr target "blockid")]
                         (cond
-                          (and block-id (util/uuid-string? block-id))
+                          (state/selection?)
                           (do
                             (util/stop e)
                             (let [client-x (gobj/get e "clientX")
                                   client-y (gobj/get e "clientY")
                                   scroll-y (util/cur-doc-top)]
-                              (state/show-custom-context-menu! (block-context-menu-content target (cljs.core/uuid block-id)))
+                              (state/show-custom-context-menu! (custom-context-menu-content))
                               (when-let [context-menu (d/by-id "custom-context-menu")]
                                 (d/set-style! context-menu
                                               :left (str client-x "px")
                                               :top (str (+ scroll-y client-y) "px")))))
 
-                          (state/selection?)
+                          (and block-id (util/uuid-string? block-id))
                           (do
                             (util/stop e)
                             (let [client-x (gobj/get e "clientX")
                                   client-y (gobj/get e "clientY")
                                   scroll-y (util/cur-doc-top)]
-                              (state/show-custom-context-menu! (custom-context-menu-content))
+                              (state/show-custom-context-menu! (block-context-menu-content target (cljs.core/uuid block-id)))
                               (when-let [context-menu (d/by-id "custom-context-menu")]
                                 (d/set-style! context-menu
                                               :left (str client-x "px")