From 05c77d0248743ca00064076e2ac0169099c186f6 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Fri, 25 Feb 2022 12:33:19 +0100 Subject: [PATCH] :bug: Fix problem with collapsing pages --- frontend/src/app/main/ui/workspace.cljs | 2 +- .../app/main/ui/workspace/sidebar/sitemap.cljs | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/main/ui/workspace.cljs b/frontend/src/app/main/ui/workspace.cljs index e9d06b920..bf9f519c7 100644 --- a/frontend/src/app/main/ui/workspace.cljs +++ b/frontend/src/app/main/ui/workspace.cljs @@ -52,7 +52,7 @@ (mf/use-callback (mf/deps (:vport local)) (fn [resize-type size] - (when (:vport local) + (when (and (:vport local) (not= size (:vport local))) (st/emit! (dw/update-viewport-size resize-type size))))) node-ref (use-resize-observer on-resize)] diff --git a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs index 56ed2bf76..942c75ea5 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/sitemap.cljs @@ -209,6 +209,7 @@ {:keys [on-pointer-down on-lost-pointer-capture on-mouse-move parent-ref size]} (use-resize-hook :sitemap 200 38 400 :y false nil) + size (if @show-pages? size 38) toggle-pages (mf/use-callback #(reset! show-pages? not))] @@ -217,12 +218,13 @@ [:div.tool-window-bar [:span (tr "workspace.sidebar.sitemap")] [:div.add-page {:on-click create} i/close] - [:div.collapse-pages {:on-click toggle-pages} i/arrow-slide]] + [:div.collapse-pages {:on-click toggle-pages + :style {:transform (when (not @show-pages?) "rotate(-90deg)")}} i/arrow-slide]] + + [:div.tool-window-content + [:& pages-list {:file file :key (:id file)}]] (when @show-pages? - [:div.tool-window-content - [:& pages-list {:file file :key (:id file)}]]) - - [:div.resize-area {:on-pointer-down on-pointer-down - :on-lost-pointer-capture on-lost-pointer-capture - :on-mouse-move on-mouse-move}]])) + [:div.resize-area {:on-pointer-down on-pointer-down + :on-lost-pointer-capture on-lost-pointer-capture + :on-mouse-move on-mouse-move}])]))