mirror of
https://github.com/penpot/penpot.git
synced 2025-03-11 23:31:21 -05:00
Merge pull request #2658 from penpot/palba-inspect-bugs
Fix inspect bugs
This commit is contained in:
commit
27c4cdb5f9
4 changed files with 8 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
|||
(ns app.main.ui.viewer.handoff.right-sidebar
|
||||
(:require
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.shape-icon :as si]
|
||||
[app.main.ui.components.tab-container :refer [tab-container tab-element]]
|
||||
[app.main.ui.icons :as i]
|
||||
|
@ -73,7 +74,7 @@
|
|||
:shapes shapes
|
||||
:on-expand (fn []
|
||||
(when (= from :workspace)
|
||||
(dw/set-inspect-expanded (not expanded)))
|
||||
(st/emit! (dw/set-inspect-expanded (not @expanded))))
|
||||
(swap! expanded not))
|
||||
:from from}]]]]]
|
||||
[:div.empty
|
||||
|
@ -81,5 +82,4 @@
|
|||
[:div (tr "handoff.empty.select")]
|
||||
[:span.tool-window-bar-icon i/help]
|
||||
[:div (tr "handoff.empty.help")]
|
||||
[:button.btn-primary.action {:on-click #(dom/open-new-window "https://help.penpot.app/user-guide/inspect/")} (tr "handoff.empty.more-info")]
|
||||
])]]))
|
||||
[:button.btn-primary.action {:on-click #(dom/open-new-window "https://help.penpot.app/user-guide/inspect/")} (tr "handoff.empty.more-info")]])]]))
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
|
||||
on-frame-enter (actions/on-frame-enter frame-hover)
|
||||
on-frame-leave (actions/on-frame-leave frame-hover)
|
||||
on-frame-select (actions/on-frame-select selected)
|
||||
on-frame-select (actions/on-frame-select selected workspace-read-only?)
|
||||
|
||||
disable-events? (contains? layout :comments)
|
||||
show-comments? (= drawing-tool :comments)
|
||||
|
|
|
@ -125,16 +125,16 @@
|
|||
(st/emit! (dw/start-move-selected))))))))
|
||||
|
||||
(defn on-frame-select
|
||||
[selected]
|
||||
[selected workspace-read-only?]
|
||||
(mf/use-callback
|
||||
(mf/deps selected)
|
||||
(mf/deps selected workspace-read-only?)
|
||||
(fn [event id]
|
||||
(let [shift? (kbd/shift? event)
|
||||
selected? (contains? selected id)
|
||||
selected-drawtool (deref refs/selected-drawing-tool)]
|
||||
(st/emit! (when (or shift? (not selected?))
|
||||
(dw/select-shape id shift?))
|
||||
(when (and (nil? selected-drawtool) (not shift?))
|
||||
(when (and (nil? selected-drawtool) (not shift?) (not workspace-read-only?))
|
||||
(dw/start-move-selected)))))))
|
||||
|
||||
(defn on-frame-enter
|
||||
|
|
|
@ -97,8 +97,7 @@
|
|||
(when (= 1 (.-which event))
|
||||
(dom/prevent-default event)
|
||||
(dom/stop-propagation event)
|
||||
(when-not workspace-read-only?
|
||||
(on-frame-select event (:id frame)))))))
|
||||
(on-frame-select event (:id frame))))))
|
||||
|
||||
on-double-click
|
||||
(mf/use-callback
|
||||
|
|
Loading…
Add table
Reference in a new issue