Fix block references count display issue

Resolved https://github.com/logseq/logseq/issues/275
pull/645/head
Tienson Qin 2020-09-06 09:42:09 +08:00
parent da80086e48
commit 18c9b76e5e
1 changed files with 14 additions and 14 deletions

View File

@ -930,7 +930,8 @@
(reset! *dragging? false) (reset! *dragging? false)
(reset! *dragging-block nil) (reset! *dragging-block nil)
(editor-handler/unhighlight-block!))}] (editor-handler/unhighlight-block!))}]
[:div.flex.flex-col.relative.block-content [:div.flex.flex-row
[:div.flex-1.flex-col.relative.block-content
(cond-> {:id (str "block-content-" uuid) (cond-> {:id (str "block-content-" uuid)
:style {:cursor "text" :style {:cursor "text"
:min-height 24}} :min-height 24}}
@ -950,20 +951,19 @@
(for [[idx child] (medley/indexed (:block/body block))] (for [[idx child] (medley/indexed (:block/body block))]
(when-let [block (block-cp config child)] (when-let [block (block-cp config child)]
(rum/with-key (block-child block) (rum/with-key (block-child block)
(str uuid "-" idx))))]) (str uuid "-" idx))))])]
(when (and block-refs-count (> block-refs-count 0)) (when (and block-refs-count (> block-refs-count 0))
[:a.block.absolute.origin-top-right.py-0.px-2.rounded.bg-base-2.opacity-50.hover:opacity-100 [:div
{:title "Open block references" [:a.block.py-0.px-2.rounded.bg-base-2.opacity-50.hover:opacity-100
:style {:top -1 {:title "Open block references"
:right 0} :style {:margin-top -1}
:on-click (fn [] :on-click (fn []
(state/sidebar-add-block! (state/sidebar-add-block!
(state/get-current-repo) (state/get-current-repo)
(:db/id block) (:db/id block)
:block-ref :block-ref
{:block block}))} {:block block}))}
block-refs-count])])) block-refs-count]])]))
(rum/defc block-content-or-editor < rum/reactive (rum/defc block-content-or-editor < rum/reactive
[config {:block/keys [uuid title level body meta content dummy? page format repo children pre-block? collapsed? idx] :as block} edit-input-id block-id slide?] [config {:block/keys [uuid title level body meta content dummy? page format repo children pre-block? collapsed? idx] :as block} edit-input-id block-id slide?]