mirror of
https://github.com/penpot/penpot.git
synced 2025-05-09 23:36:38 +02:00
🐛 Deactivate comments on drawing.
This commit is contained in:
parent
52532253c3
commit
bf8e61b9bb
2 changed files with 21 additions and 21 deletions
|
@ -393,14 +393,12 @@
|
||||||
(defn- check-sidebars
|
(defn- check-sidebars
|
||||||
[state]
|
[state]
|
||||||
(let [layout (:workspace-layout state)
|
(let [layout (:workspace-layout state)
|
||||||
left-sidebar? (not (empty? (keep layout [:layers
|
left? (seq (keep layout [:layers :sitemap :document-history :assets]))
|
||||||
:sitemap
|
right? (seq (keep layout [:element-options :comments]))]
|
||||||
:document-history
|
|
||||||
:assets])))
|
|
||||||
right-sidebar? (not (empty? (keep layout [:element-options :comments])))]
|
|
||||||
(update state :workspace-local
|
(update state :workspace-local
|
||||||
assoc :left-sidebar? left-sidebar?
|
assoc :left-sidebar? (boolean left?)
|
||||||
:right-sidebar? right-sidebar?)))
|
:right-sidebar? (boolean right?))))
|
||||||
|
|
||||||
(defn- check-auto-flags
|
(defn- check-auto-flags
|
||||||
[state flags-to-toggle]
|
[state flags-to-toggle]
|
||||||
|
@ -419,13 +417,13 @@
|
||||||
(contains? flags-to-toggle :document-history)
|
(contains? flags-to-toggle :document-history)
|
||||||
(disj :assets :sitemap :layers)
|
(disj :assets :sitemap :layers)
|
||||||
|
|
||||||
(and (contains? flags-to-toggle :comments)
|
(contains? flags-to-toggle :comments)
|
||||||
(contains? flags :comments))
|
(as-> $ (if (contains? flags :comments)
|
||||||
(disj :element-options)
|
(disj $ :element-options)
|
||||||
|
(conj $ :element-options)))
|
||||||
|
|
||||||
(and (contains? flags-to-toggle :comments)
|
(contains? flags-to-toggle :element-options)
|
||||||
(not (contains? flags :comments)))
|
(disj :comments)))))
|
||||||
(conj :element-options)))))
|
|
||||||
|
|
||||||
(defn toggle-layout-flags
|
(defn toggle-layout-flags
|
||||||
[& flags]
|
[& flags]
|
||||||
|
@ -1059,6 +1057,8 @@
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(update state :workspace-drawing dissoc :tool :object))))
|
(update state :workspace-drawing dissoc :tool :object))))
|
||||||
|
|
||||||
|
(declare toggle-layout-flags)
|
||||||
|
|
||||||
(defn select-for-drawing
|
(defn select-for-drawing
|
||||||
([tool] (select-for-drawing tool nil))
|
([tool] (select-for-drawing tool nil))
|
||||||
([tool data]
|
([tool data]
|
||||||
|
@ -1069,13 +1069,14 @@
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state stream]
|
(watch [_ state stream]
|
||||||
(let [cancel-event? (fn [event]
|
(let [stoper (rx/filter (ptk/type? ::clear-drawing) stream)]
|
||||||
(dwc/interrupt? event))
|
(rx/merge
|
||||||
stoper (rx/filter (ptk/type? ::clear-drawing) stream)]
|
(rx/of (toggle-layout-flags :element-options))
|
||||||
(->> (rx/filter cancel-event? stream)
|
(->> stream
|
||||||
|
(rx/filter dwc/interrupt?)
|
||||||
(rx/take 1)
|
(rx/take 1)
|
||||||
(rx/map (constantly clear-drawing))
|
(rx/map (constantly clear-drawing))
|
||||||
(rx/take-until stoper)))))))
|
(rx/take-until stoper))))))))
|
||||||
|
|
||||||
;; --- Update Dimensions
|
;; --- Update Dimensions
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.core :as ptk]))
|
[potok.core :as ptk]))
|
||||||
|
|
||||||
|
|
||||||
(s/def ::comment-thread any?)
|
(s/def ::comment-thread any?)
|
||||||
(s/def ::comment any?)
|
(s/def ::comment any?)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue