mirror of https://github.com/logseq/logseq
enhance: don't show the plus icon in editing mode
parent
c087767be1
commit
fa197b71d5
|
@ -109,17 +109,18 @@
|
||||||
[:span.opacity-50
|
[:span.opacity-50
|
||||||
"Click here to edit..."]]]])
|
"Click here to edit..."]]]])
|
||||||
|
|
||||||
(rum/defc add-button
|
(rum/defc add-button < rum/reactive
|
||||||
[page-name]
|
[page-name]
|
||||||
[:div.ls-block.flex-1.flex-col.rounded-sm {:style {:width "100%"}}
|
[:div.ls-block.flex-1.flex-col.rounded-sm {:style {:width "100%"}}
|
||||||
[:div.flex.flex-row
|
[:div.flex.flex-row
|
||||||
[:div {:style {:height 24
|
[:div {:style {:height 24
|
||||||
:margin-left 2}}
|
:margin-left 2}}
|
||||||
[:a.add-button-link
|
(when-not (state/sub [:editor/block])
|
||||||
{:on-click (fn []
|
[:a.add-button-link
|
||||||
(when-let [block (editor-handler/api-insert-new-block! "" {:page page-name})]
|
{:on-click (fn []
|
||||||
(js/setTimeout #(editor-handler/edit-block! block :max nil (:block/uuid block)) 100)))}
|
(when-let [block (editor-handler/api-insert-new-block! "" {:page page-name})]
|
||||||
svg/plus-circle]]]])
|
(js/setTimeout #(editor-handler/edit-block! block :max nil (:block/uuid block)) 100)))}
|
||||||
|
svg/plus-circle])]]])
|
||||||
|
|
||||||
(rum/defc page-blocks-cp < rum/reactive
|
(rum/defc page-blocks-cp < rum/reactive
|
||||||
db-mixins/query
|
db-mixins/query
|
||||||
|
@ -151,7 +152,8 @@
|
||||||
hiccup (block/->hiccup page-blocks hiccup-config {})]
|
hiccup (block/->hiccup page-blocks hiccup-config {})]
|
||||||
[:div
|
[:div
|
||||||
(page-blocks-inner page-name page-blocks hiccup sidebar? preview?)
|
(page-blocks-inner page-name page-blocks hiccup sidebar? preview?)
|
||||||
(when (and (not block?) (not config/publishing?))
|
(when (and (not block?)
|
||||||
|
(not config/publishing?))
|
||||||
(add-button page-name))])))))
|
(add-button page-name))])))))
|
||||||
|
|
||||||
(defn contents-page
|
(defn contents-page
|
||||||
|
|
Loading…
Reference in New Issue