mirror of https://github.com/logseq/logseq
fix: can't use property shortcuts
parent
ec2cc78997
commit
0b580fcdfc
|
@ -473,7 +473,6 @@
|
|||
|
||||
(rum/defcs property-input < rum/reactive
|
||||
(rum/local nil ::ref)
|
||||
(rum/local nil ::property)
|
||||
(rum/local false ::show-new-property-config?)
|
||||
(rum/local false ::show-class-select?)
|
||||
(rum/local {} ::property-schema)
|
||||
|
@ -489,7 +488,8 @@
|
|||
(.focus input)))))))
|
||||
{:init (fn [state]
|
||||
(state/set-editor-action! :property-input)
|
||||
state)
|
||||
(assoc state ::property (or (:*property (last (:rum/args state)))
|
||||
(atom nil))))
|
||||
:will-unmount (fn [state]
|
||||
(let [args (:rum/args state)
|
||||
*property-key (second args)
|
||||
|
@ -517,7 +517,7 @@
|
|||
;; Filters out properties from being in wrong :view-context
|
||||
(and (not page?) (= :page (get-in m [:block/schema :view-context])))
|
||||
(and page? (= :block (get-in m [:block/schema :view-context])))))
|
||||
property @*property
|
||||
property (rum/react *property)
|
||||
property-key (rum/react *property-key)]
|
||||
[:div.ls-property-input.flex.flex-1.flex-row.items-center.flex-wrap.gap-1
|
||||
{:ref #(reset! *ref %)}
|
||||
|
|
|
@ -3,17 +3,24 @@
|
|||
(:require [frontend.components.property :as property-component]
|
||||
[rum.core :as rum]
|
||||
[frontend.modules.shortcut.core :as shortcut]
|
||||
[logseq.db :as ldb]))
|
||||
[logseq.db :as ldb]
|
||||
[frontend.db :as db]))
|
||||
|
||||
(rum/defcs dialog <
|
||||
shortcut/disable-all-shortcuts
|
||||
(rum/local nil ::property-value)
|
||||
{:init (fn [state]
|
||||
(assoc state ::property-key (atom (:property-key (last (:rum/args state))))))}
|
||||
(let [k (:property-key (last (:rum/args state)))]
|
||||
(assoc state
|
||||
::property-key (atom k)
|
||||
::property (atom (when k (db/get-page k))))))}
|
||||
[state blocks opts]
|
||||
(when (seq blocks)
|
||||
(let [*property-key (::property-key state)
|
||||
*property (::property state)
|
||||
block (first blocks)
|
||||
page? (ldb/page? block)]
|
||||
[:div.ls-property-dialog
|
||||
(property-component/property-input block *property-key (assoc opts :page? page?))])))
|
||||
(property-component/property-input block *property-key (assoc opts
|
||||
:*property *property
|
||||
:page? page?))])))
|
||||
|
|
Loading…
Reference in New Issue