0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

🐛 Fix problem with collapsing pages

This commit is contained in:
alonso.torres 2022-02-25 12:33:19 +01:00 committed by Andrey Antukh
parent 2fc4c30bed
commit 05c77d0248
2 changed files with 10 additions and 8 deletions

View file

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

View file

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