Browse Source

enhance: don't show tags in gallery view

Tienson Qin 1 year ago
parent
commit
54a47c4e9e
1 changed files with 11 additions and 10 deletions
  1. 11 10
      src/main/frontend/components/block.cljs

+ 11 - 10
src/main/frontend/components/block.cljs

@@ -2056,11 +2056,11 @@
         icon-size          (if collapsed? 12 14)
         icon-size          (if collapsed? 12 14)
         icon               (icon-component/get-node-icon-cp block {:size icon-size :color? true})
         icon               (icon-component/get-node-icon-cp block {:size icon-size :color? true})
         with-icon?          (and (some? icon)
         with-icon?          (and (some? icon)
-                             (or (db/page? block)
-                               (:logseq.property/icon block)
-                               link?
-                               (some :logseq.property/icon (:block/tags block))
-                               (contains? #{"pdf"} (:logseq.property.asset/type block))))]
+                                 (or (db/page? block)
+                                     (:logseq.property/icon block)
+                                     link?
+                                     (some :logseq.property/icon (:block/tags block))
+                                     (contains? #{"pdf"} (:logseq.property.asset/type block))))]
     [:div.block-control-wrap.flex.flex-row.items-center.h-6
     [:div.block-control-wrap.flex.flex-row.items-center.h-6
      {:class (util/classnames [{:is-order-list order-list?
      {:class (util/classnames [{:is-order-list order-list?
                                 :is-with-icon  with-icon?
                                 :is-with-icon  with-icon?
@@ -2104,11 +2104,11 @@
                       (if with-icon?
                       (if with-icon?
                         icon
                         icon
                         [:span.bullet (cond->
                         [:span.bullet (cond->
-                                        {:blockid (str uuid)}
+                                       {:blockid (str uuid)}
                                         selected?
                                         selected?
                                         (assoc :class "selected"))
                                         (assoc :class "selected"))
                          (when
                          (when
-                           order-list?
+                          order-list?
                            [:label (str order-list-idx ".")])])]]]
                            [:label (str order-list-idx ".")])])]]]
          (cond
          (cond
            (and (or (mobile-util/native-platform?)
            (and (or (mobile-util/native-platform?)
@@ -2894,7 +2894,8 @@
        (when-not (or (:table? config) (:property? config) (:page-title? config))
        (when-not (or (:table? config) (:property? config) (:page-title? config))
          (block-refs-count block refs-count *hide-block-refs?))
          (block-refs-count block refs-count *hide-block-refs?))
 
 
-       (when-not (or (:block-ref? config) (:table? config) (:property? config))
+       (when-not (or (:block-ref? config) (:table? config) (:gallery-view? config)
+                     (:property? config))
          (when (and db-based? (seq (:block/tags block)))
          (when (and db-based? (seq (:block/tags block)))
            (tags-cp (assoc config :block/uuid (:block/uuid block)) block)))]
            (tags-cp (assoc config :block/uuid (:block/uuid block)) block)))]
 
 
@@ -3764,8 +3765,8 @@
                                (when-let [^js cm (util/get-cm-instance (util/rec-get-node (.-target e) "ls-block"))]
                                (when-let [^js cm (util/get-cm-instance (util/rec-get-node (.-target e) "ls-block"))]
                                  (util/copy-to-clipboard! (.getValue cm))
                                  (util/copy-to-clipboard! (.getValue cm))
                                  (notification/show! "Copied!" :success)))}
                                  (notification/show! "Copied!" :success)))}
-                   (ui/icon "copy")
-                   "Copy")]
+                  (ui/icon "copy")
+                  "Copy")]
                 (lazy-editor/editor config (str (d/squuid)) attr code options)
                 (lazy-editor/editor config (str (d/squuid)) attr code options)
                 (let [options (:options options) block (:block config)]
                 (let [options (:options options) block (:block config)]
                   (when (and (= language "clojure") (contains? (set options) ":results"))
                   (when (and (= language "clojure") (contains? (set options) ":results"))