Browse Source

Fix: no collapse control on collapsed query block for mobile (#9233)

* fix(mobile): no collapse control for query block
Andelf 2 years ago
parent
commit
c3d50879d2
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/main/frontend/components/block.cljs

+ 5 - 4
src/main/frontend/components/block.cljs

@@ -1727,14 +1727,15 @@
    (every? #(= % ["Horizontal_Rule"]) body)))
 
 (rum/defcs block-control < rum/reactive
-  [state config block uuid block-id collapsed? *control-show? edit? has-child?]
+  [state config block uuid block-id collapsed? *control-show? edit?]
   (let [doc-mode? (state/sub :document/mode?)
         control-show? (util/react *control-show?)
         ref? (:ref? config)
         empty-content? (block-content-empty? block)
-        fold-button-right? (state/enable-fold-button-right?)]
+        fold-button-right? (state/enable-fold-button-right?)
+        collapsable? (editor-handler/collapsable? uuid {:semantic? true})]
     [:div.block-control-wrap.mr-1.flex.flex-row.items-center.sm:mr-2
-     (when (or (not fold-button-right?) has-child?)
+     (when (or (not fold-button-right?) collapsable?)
        [:a.block-control
         {:id       (str "control-" uuid)
          :on-click (fn [event]
@@ -2846,7 +2847,7 @@
        :on-mouse-leave (fn [e]
                          (block-mouse-leave e *control-show? block-id doc-mode?))}
       (when (not slide?)
-        (block-control config block uuid block-id collapsed? *control-show? edit? has-child?))
+        (block-control config block uuid block-id collapsed? *control-show? edit?))
 
       (when @*show-left-menu?
         (block-left-menu config block))