Merge branch 'master' into feature/publishing

pull/645/head
Tienson Qin 2020-09-30 22:23:09 +08:00
commit c9b14a0cc5
2 changed files with 15 additions and 12 deletions

View File

@ -78,12 +78,11 @@
(str encoded-page-name "-hiccup"))))
(defn contents-page
[contents]
(let [page-name "contents"]
(when-let [repo (state/get-current-repo)]
(let [format (db/get-page-format page-name)
file-path (:file/path (:page/file contents))]
(page-blocks-cp repo contents file-path page-name page-name page-name true false false nil format)))))
[{:page/keys [name original-name file] :as contents}]
(when-let [repo (state/get-current-repo)]
(let [format (db/get-page-format name)
file-path (:file/path file)]
(page-blocks-cp repo contents file-path name original-name name true false false nil format))))
(defn presentation
[repo page journal?]
@ -309,7 +308,8 @@
(svg/vertical-dots {:class (util/hiccup->class "opacity-50.hover:opacity-100.h-5.w-5")})])
links
{:modal-class (util/hiccup->class
"origin-top-right.absolute.right-0.top-10.mt-2.rounded-md.shadow-lg.whitespace-no-wrap.dropdown-overflow-auto.page-drop-options")}))))
"origin-top-right.absolute.right-0.top-10.mt-2.rounded-md.shadow-lg.whitespace-no-wrap.dropdown-overflow-auto.page-drop-options")
:z-index 1}))))
(when (and (not sidebar?)
(not block?))
[:a {:on-click (fn [e]

View File

@ -31,10 +31,13 @@
;; public exports
(rum/defcs dropdown < (mixins/modal :open?)
[state content-fn modal-content-fn modal-class]
[state content-fn modal-content-fn
& [{:keys [modal-class z-index]
:or {z-index 999}
:as opts}]]
(let [{:keys [open? toggle-fn]} state
modal-content (modal-content-fn state)]
[:div.ml-1.relative {:style {:z-index 999}}
modal-content (modal-content-fn state)]
[:div.ml-1.relative {:style {:z-index z-index}}
(content-fn state)
(css-transition
{:in @open? :timeout 0}
@ -49,7 +52,7 @@
child])
(rum/defc dropdown-with-links
[content-fn links {:keys [modal-class links-header]}]
[content-fn links {:keys [modal-class links-header z-index] :as opts}]
(dropdown
content-fn
(fn [{:keys [close-fn] :as state}]
@ -72,7 +75,7 @@
(rum/with-key
(menu-link new-options child)
(cljs.core/random-uuid))))])
modal-class))
opts))
(defn button
[text & {:keys [background on-click href]