tempory fix for wrong positions of custom context menu

which is caused by the bump of rum too.
This commit is contained in:
Tienson Qin
2022-04-01 07:03:58 +08:00
parent b7348af7d4
commit 3758a9e1c0
3 changed files with 20 additions and 10 deletions

View File

@@ -228,10 +228,15 @@
client-y (gobj/get e "clientY")
scroll-y (util/cur-doc-top)]
(state/show-custom-context-menu! context-menu-content)
(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")))))
;; 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)))
(defn parse-config
"Parse configuration from file `content` such as from config.edn."