소스 검색

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

charlie 3 년 전
부모
커밋
776e206249
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      src/main/frontend/state.cljs

+ 3 - 2
src/main/frontend/state.cljs

@@ -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)