improve(ux): support close-backdrop? for sub modal

This commit is contained in:
charlie
2022-10-14 18:34:52 +08:00
committed by Tienson Qin
parent ea2210bde8
commit 776e206249

View File

@@ -1262,7 +1262,7 @@ Similar to re-frame subscriptions"
([panel-content]
(set-sub-modal! panel-content
{:close-btn? true}))
([panel-content {:keys [id label close-btn? show? center?] :as opts}]
([panel-content {:keys [id label close-btn? close-backdrop? show? center?] :as opts}]
(if (not (modal-opened?))
(set-modal! panel-content opts)
(let [modals (:modal/subsets @state)
@@ -1274,7 +1274,8 @@ Similar to re-frame subscriptions"
:modal/label (or label (if center? "ls-modal-align-center" ""))
:modal/show? (if (boolean? show?) show? true)
:modal/panel-content panel-content
:modal/close-btn? close-btn?})]
:modal/close-btn? close-btn?
:modal/close-backdrop? (if (boolean? close-backdrop?) close-backdrop? true)})]
(swap! state update-in
[:modal/subsets (or idx (count modals))]
merge input)