mirror of
https://github.com/logseq/logseq.git
synced 2026-04-27 23:54:55 +00:00
enhance: context and dropdown menu
This commit is contained in:
committed by
Andelf
parent
6642b46cc8
commit
bc21daee88
@@ -116,19 +116,8 @@
|
||||
|
||||
(defn show-custom-context-menu! [e context-menu-content]
|
||||
(util/stop e)
|
||||
(let [client-x (gobj/get e "clientX")
|
||||
client-y (gobj/get e "clientY")
|
||||
scroll-y (util/cur-doc-top)]
|
||||
(state/show-custom-context-menu! context-menu-content)
|
||||
|
||||
;; FIXME: use setTimeout here because rum renders lazily.
|
||||
(js/setTimeout
|
||||
(fn []
|
||||
(when-let [context-menu (d/by-id "custom-context-menu")]
|
||||
(d/set-style! context-menu
|
||||
:left (str client-x "px")
|
||||
:top (str (+ scroll-y client-y) "px"))))
|
||||
10)))
|
||||
(let [position [(gobj/get e "clientX") (gobj/get e "clientY")]]
|
||||
(state/show-custom-context-menu! context-menu-content position)))
|
||||
|
||||
(defn parse-config
|
||||
"Parse configuration from file `content` such as from config.edn."
|
||||
|
||||
Reference in New Issue
Block a user