fix: modals positions

close https://github.com/logseq/logseq/issues/5053
pull/5095/head
llcc 2022-04-24 13:31:31 +08:00 committed by Tienson Qin
parent 8d8dde5024
commit 3f8296135b
3 changed files with 17 additions and 5 deletions

View File

@ -117,7 +117,7 @@
:on-enter on-submit) 100))))
[]
(let [{:keys [time repeater]} (rum/react *timestamp)]
[:div#time-repeater.py-1.px-4 {:style {:min-width 300}}
[:div#time-repeater.py-1.px-4
[:p.text-sm.opacity-50.font-medium.mt-4 "Time:"]
(time-input time)

View File

@ -387,7 +387,6 @@
(when (> ofx 0)
(set! (.-transform (.-style el)) (str "translateX(-" (+ ofx 20) "px)")))))))
[right-sidebar? editing-key])
;; FIXME: for translateY layer
x-overflow-vw? (when (and (seq rect) (> vw-width max-width))
(let [delta-width (- vw-width (+ (:left rect) left))]
(< delta-width (* max-width 0.5))))
@ -408,9 +407,11 @@
:z-index 11}
(when set-default-width?
{:width max-width})
(if config/mobile?
{:left 0}
{:left (if (and y-diff (= y-diff 0)) left 0)}))}
(let [^js/HTMLElement textarea
(js/document.querySelector "textarea")]
(if (<= (.-clientWidth textarea) (+ left (if set-default-width? max-width 500)))
{:right 0}
{:left (if (and y-diff (= y-diff 0)) left 0)})))}
cp]))
(rum/defc transition-cp < rum/reactive

View File

@ -93,3 +93,14 @@ pre {
.preview-trigger-wrapper > [data-tooltipped] {
display: block !important;
}
#time-repeater {
width: 135px;
@screen sm {
min-width: 300px;
}
}