mirror of
https://github.com/penpot/penpot.git
synced 2025-05-25 16:16:10 +02:00
Merge pull request #2834 from penpot/superalex-fix-ctrl-c-in-inspect-code
🐛 Fix ctrl+c on inspect code
This commit is contained in:
commit
09a91c87be
2 changed files with 17 additions and 13 deletions
|
@ -1311,16 +1311,22 @@
|
|||
:file-id (:current-file-id state)
|
||||
:selected selected
|
||||
:objects {}
|
||||
:images #{}}]
|
||||
:images #{}}
|
||||
selected_text (.. js/window getSelection toString)]
|
||||
|
||||
(->> (rx/from (seq (vals pdata)))
|
||||
(rx/merge-map (partial prepare-object objects selected+children))
|
||||
(rx/reduce collect-data initial)
|
||||
(rx/map (partial sort-selected state))
|
||||
(rx/map t/encode-str)
|
||||
(rx/map wapi/write-to-clipboard)
|
||||
(rx/catch on-copy-error)
|
||||
(rx/ignore)))))))
|
||||
(if (not-empty selected_text)
|
||||
(try
|
||||
(wapi/write-to-clipboard selected_text)
|
||||
(catch :default e
|
||||
(on-copy-error e)))
|
||||
(->> (rx/from (seq (vals pdata)))
|
||||
(rx/merge-map (partial prepare-object objects selected+children))
|
||||
(rx/reduce collect-data initial)
|
||||
(rx/map (partial sort-selected state))
|
||||
(rx/map t/encode-str)
|
||||
(rx/map wapi/write-to-clipboard)
|
||||
(rx/catch on-copy-error)
|
||||
(rx/ignore))))))))
|
||||
|
||||
(declare paste-shape)
|
||||
(declare paste-text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue