Explorar o código

fix: can't open mobile popup

Tienson Qin hai 7 meses
pai
achega
f79fafe7fc
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  1. 4 5
      src/main/capacitor/components/popup.cljs

+ 4 - 5
src/main/capacitor/components/popup.cljs

@@ -13,10 +13,10 @@
                    vh js/window.innerHeight
                    vh js/window.innerHeight
                    [th bh] [y (- vh (+ y height) 300)]]
                    [th bh] [y (- vh (+ y height) 300)]]
                (if (> bh 200) "bottom"
                (if (> bh 200) "bottom"
-                 (if (> (- th bh) 100)
-                   "top" "bottom")))]
+                   (if (> (- th bh) 100)
+                     "top" "bottom")))]
     (-> (assoc opts :auto-side? false)
     (-> (assoc opts :auto-side? false)
-      (assoc-in [:content-props :side] side))))
+        (assoc-in [:content-props :side] side))))
 
 
 (defn popup-show!
 (defn popup-show!
   [event content-fn {:keys [id dropdown-menu?] :as opts}]
   [event content-fn {:keys [id dropdown-menu?] :as opts}]
@@ -40,8 +40,7 @@
 
 
 (defn popup-hide!
 (defn popup-hide!
   [& args]
   [& args]
-  (if @*last-popup-modal?
-    (state/set-popup! nil)
+  (when-not  @*last-popup-modal?
     (apply shui-popup/hide! args)))
     (apply shui-popup/hide! args)))
 
 
 (set! shui/popup-show! popup-show!)
 (set! shui/popup-show! popup-show!)