mirror of https://github.com/logseq/logseq
fix: nested page title can't be clicked
parent
8b8bd04ced
commit
6b94181116
|
@ -37,7 +37,9 @@
|
|||
[logseq.graph-parser.util :as gp-util]
|
||||
[medley.core :as medley]
|
||||
[reitit.frontend.easy :as rfe]
|
||||
[rum.core :as rum]))
|
||||
[rum.core :as rum]
|
||||
[logseq.graph-parser.util.page-ref :as page-ref]
|
||||
[logseq.graph-parser.mldoc :as gp-mldoc]))
|
||||
|
||||
(defn- get-page-name
|
||||
[state]
|
||||
|
@ -292,8 +294,8 @@
|
|||
(rum/local false ::edit?)
|
||||
(rum/local "" ::input-value)
|
||||
{:init (fn [state]
|
||||
(assoc state ::title-value (atom (nth (:rum/args state) 2))))}
|
||||
[state page-name icon title _format fmt-journal?]
|
||||
(assoc state ::title-value (atom (nth (:rum/args state) 3))))}
|
||||
[state page page-name icon title _format fmt-journal?]
|
||||
(when title
|
||||
(let [*title-value (get state ::title-value)
|
||||
*edit? (get state ::edit?)
|
||||
|
@ -304,7 +306,9 @@
|
|||
untitled? (and whiteboard-page? (parse-uuid page-name)) ;; normal page cannot be untitled right?
|
||||
title (if hls-page?
|
||||
[:a.asset-ref (pdf-utils/fix-local-asset-pagename title)]
|
||||
(if fmt-journal? (date/journal-title->custom-format title) title))
|
||||
(if fmt-journal?
|
||||
(date/journal-title->custom-format title)
|
||||
title))
|
||||
old-name (or title page-name)]
|
||||
[:h1.page-title.flex.cursor-pointer.gap-1.w-full
|
||||
{:class (when-not whiteboard-page? "title")
|
||||
|
@ -337,9 +341,13 @@
|
|||
{:data-value @*input-value
|
||||
:data-ref page-name
|
||||
:style {:opacity (when @*edit? 0)}}
|
||||
(let [nested? (and (string/includes? title page-ref/left-brackets)
|
||||
(string/includes? title page-ref/right-brackets))]
|
||||
(cond @*edit? [:span {:style {:white-space "pre"}} (rum/react *input-value)]
|
||||
untitled? [:span.opacity-50 (t :untitled)]
|
||||
:else title)]]])))
|
||||
nested? (component-block/map-inline {} (gp-mldoc/inline->edn title (gp-mldoc/default-config
|
||||
(:block/format page))))
|
||||
:else title))]]])))
|
||||
|
||||
(defn- page-mouse-over
|
||||
[e *control-show? *all-collapsed?]
|
||||
|
@ -440,7 +448,7 @@
|
|||
(page-blocks-collapse-control title *control-show? *all-collapsed?)])
|
||||
(when-not whiteboard?
|
||||
[:div.ls-page-title.flex-1.flex-row.w-full
|
||||
(page-title page-name icon title format fmt-journal?)])
|
||||
(page-title page page-name icon title format fmt-journal?)])
|
||||
(when (not config/publishing?)
|
||||
(when config/lsp-enabled?
|
||||
[:div.flex.flex-row
|
||||
|
|
|
@ -276,7 +276,7 @@ a.page-title {
|
|||
}
|
||||
|
||||
> .title {
|
||||
@apply w-full pointer-events-none overflow-hidden overflow-ellipsis;
|
||||
@apply w-full overflow-hidden overflow-ellipsis;
|
||||
}
|
||||
|
||||
.edit-input {
|
||||
|
|
Loading…
Reference in New Issue