Skip to content

Commit

Permalink
enhance(ux): copy raw code editor content
Browse files Browse the repository at this point in the history
  • Loading branch information
xyhp915 committed Nov 4, 2024
1 parent 81918d9 commit 9cbc598
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/frontend/components/block.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3759,11 +3759,13 @@
(shui/button
{:variant :text
:size :sm
:on-click (fn [e]
:on-click (fn [^js e]
(util/stop-propagation e)
(editor-handler/copy-block-content! block))}
(ui/icon "copy")
"Copy")]
(when-let [^js cm (util/get-cm-instance (util/rec-get-node (.-target e) "ls-block"))]
(util/copy-to-clipboard! (.getValue cm))
(notification/show! "Copied!" :success)))}
(ui/icon "copy")
"Copy")]
(lazy-editor/editor config (str (d/squuid)) attr code options)
(let [options (:options options) block (:block config)]
(when (and (= language "clojure") (contains? (set options) ":results"))
Expand Down

0 comments on commit 9cbc598

Please sign in to comment.