Просмотр исходного кода

fix: mobile page shouldn't be wrapped in main-content-container

Tienson Qin 7 месяцев назад
Родитель
Сommit
8cea00219c

+ 0 - 1
src/main/capacitor/components/popup.cljs

@@ -22,7 +22,6 @@
   [event content-fn {:keys [id dropdown-menu?] :as opts}]
   (cond
     (and (keyword? id) (= "editor.commands" (namespace id)))
-    ;; FIXME: Editing a block at bottom will scroll to top
     (let [opts (warp-calc-commands-popup-side event opts)
           pid (shui-popup/show! event content-fn opts)]
       (reset! *last-popup-modal? false) pid)

+ 3 - 3
src/main/capacitor/components/ui.cljs

@@ -3,8 +3,8 @@
             [cljs-bean.core :as bean]
             [frontend.handler.notification :as notification]
             [frontend.rum :as r]
-            [frontend.ui :as ui]
             [frontend.state :as fstate]
+            [frontend.ui :as ui]
             [medley.core :as medley]
             [react-transition-group :refer [CSSTransition TransitionGroup]]
             [rum.core :as rum]))
@@ -26,7 +26,7 @@
   [:main#app-container-wrapper.ls-fold-button-on-right
    [:div#app-container.pt-2
     [:div#main-container.flex.flex-1
-     [:div#main-content-container.w-full.!px-0 content]]]])
+     [:div.w-full content]]]])
 
 (rum/defc notification-clear-all
   []
@@ -196,4 +196,4 @@
 
 (rum/defc loading
   ([] (loading ""))
-  ([content] [:span.opacity-50 (ui/loading content)]))
+  ([content] [:span.opacity-50 (ui/loading content)]))

+ 1 - 1
src/main/frontend/handler/common.cljs

@@ -51,7 +51,7 @@
                     (state/set-state! :ui/scrolling? true)
                     (state/save-scroll-position! (util/scroll-top))
                     (state/save-main-container-position!
-                     (-> (gdom/getElement "main-content-container")
+                     (-> (util/app-scroll-container-node)
                          (gobj/get "scrollTop")))
                     (reset! *scroll-timer (js/setTimeout
                                            (fn [] (state/set-state! :ui/scrolling? false)) 500)))

+ 1 - 1
src/main/frontend/util.cljc

@@ -1293,7 +1293,7 @@
            (.scrollBy main-node (bean/->js {:top (- (+ offset-height 4))}))
 
            (> scroll 0)
-           (set! (.-scrollTop main-node) (+ scroll-top' scroll 32))
+           (set! (.-scrollTop main-node) (+ scroll-top' scroll))
 
            :else
            nil)))))