fix: clicking on some links not working anymore

Resolved #975.

Also, I made some css tweaks.
This commit is contained in:
Tienson Qin
2020-12-22 15:55:03 +08:00
parent 2df3af03aa
commit 00e0ced252
4 changed files with 35 additions and 27 deletions

View File

@@ -1254,22 +1254,24 @@
(js/window.history.forward)))
(defn zoom-out! []
(when-let [page (state/get-current-page)]
(let [block-id (and
(string? page)
(util/uuid-string? page)
(medley/uuid page))
repo (state/get-current-repo)
block-parent (db/get-block-parent repo block-id)]
(if-let [id (:block/uuid block-parent)]
(route-handler/redirect! {:to :page
:path-params {:name (str id)}})
(let [page-id (-> (db/entity [:block/uuid block-id])
:block/page
:db/id)]
(when-let [page-name (:page/name (db/entity repo page-id))]
(route-handler/redirect! {:to :page
:path-params {:name page-name}})))))))
(let [page (state/get-current-page)
block-id (and
(string? page)
(util/uuid-string? page)
(medley/uuid page))]
(if block-id
(let [repo (state/get-current-repo)
block-parent (db/get-block-parent repo block-id)]
(if-let [id (:block/uuid block-parent)]
(route-handler/redirect! {:to :page
:path-params {:name (str id)}})
(let [page-id (-> (db/entity [:block/uuid block-id])
:block/page
:db/id)]
(when-let [page-name (:page/name (db/entity repo page-id))]
(route-handler/redirect! {:to :page
:path-params {:name page-name}})))))
(js/window.history.back))))
(defn cut-block!
[block-id]