mirror of
https://github.com/logseq/logseq.git
synced 2026-05-21 19:24:17 +00:00
fix(mobile): set property value doesn't close popup
This commit is contained in:
@@ -260,11 +260,16 @@
|
||||
(defmethod events/handle :dialog-select/db-graph-replace []
|
||||
(select/dialog-select! :db-graph-replace))
|
||||
|
||||
(defn- hide-action-bar!
|
||||
[]
|
||||
(when (editor-handler/popup-exists? :selection-action-bar)
|
||||
(shui/popup-hide! :selection-action-bar)))
|
||||
|
||||
(defmethod events/handle :editor/show-action-bar []
|
||||
(let [selection (state/get-selection-blocks)
|
||||
first-visible-block (some #(when (util/el-visible-in-viewport? % true) %) selection)]
|
||||
(when first-visible-block
|
||||
(shui/popup-hide! :selection-action-bar)
|
||||
(hide-action-bar!)
|
||||
(shui/popup-show!
|
||||
first-visible-block
|
||||
(fn []
|
||||
@@ -278,7 +283,7 @@
|
||||
:align :start}))))
|
||||
|
||||
(defmethod events/handle :editor/hide-action-bar []
|
||||
(shui/popup-hide! :selection-action-bar)
|
||||
(hide-action-bar!)
|
||||
(state/set-state! :mobile/show-action-bar? false))
|
||||
|
||||
(defmethod events/handle :user/logout [[_]]
|
||||
|
||||
@@ -61,9 +61,11 @@
|
||||
(some-> (shui-popup/get-last-popup) :content-props :class)))
|
||||
(defn hide-popups-until-preview-popup!
|
||||
[]
|
||||
(while (and (shui-popups?)
|
||||
(not (last-shui-preview-popup?)))
|
||||
(shui/popup-hide!)))
|
||||
(if (util/mobile?)
|
||||
(shui/popup-hide!)
|
||||
(while (and (shui-popups?)
|
||||
(not (last-shui-preview-popup?)))
|
||||
(shui/popup-hide!))))
|
||||
|
||||
(def built-in-colors
|
||||
["yellow"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
(ns mobile.components.popup
|
||||
"Mobile popup"
|
||||
(:require [mobile.ionic :as ion]
|
||||
[mobile.state :as mobile-state]
|
||||
[dommy.core :as dom]
|
||||
(:require [dommy.core :as dom]
|
||||
[logseq.shui.popup.core :as shui-popup]
|
||||
[logseq.shui.ui :as shui]
|
||||
[mobile.ionic :as ion]
|
||||
[mobile.state :as mobile-state]
|
||||
[rum.core :as rum]))
|
||||
|
||||
(defonce *last-popup-modal? (atom nil))
|
||||
@@ -56,7 +56,8 @@
|
||||
#(.select (dom/sel1 "ion-tabs") "home") 1000))
|
||||
|
||||
:else
|
||||
(when-not @*last-popup-modal?
|
||||
(if @*last-popup-modal?
|
||||
(mobile-state/set-popup! nil)
|
||||
(apply shui-popup/hide! args))))
|
||||
|
||||
(set! shui/popup-show! popup-show!)
|
||||
|
||||
Reference in New Issue
Block a user