mirror of
https://github.com/logseq/logseq.git
synced 2026-04-29 16:36:27 +00:00
committed by
Tienson Qin
parent
f9fbb26567
commit
fb63c32a56
@@ -12,8 +12,7 @@
|
||||
[frontend.state :as state]
|
||||
[frontend.ui :as ui]
|
||||
[frontend.util :as util]
|
||||
[rum.core :as rum]
|
||||
[promesa.core :as p]))
|
||||
[rum.core :as rum]))
|
||||
|
||||
(rum/defc export
|
||||
[]
|
||||
@@ -111,13 +110,13 @@
|
||||
:scale scale
|
||||
:windowHeight (when (string? block-uuids-or-page-name)
|
||||
(.-scrollHeight container))}]
|
||||
(p/let [_ (util/js-load$ (str util/JS_ROOT "/html2canvas.min.js"))] (-> (js/html2canvas container options)
|
||||
(.then (fn [canvas] (.toBlob canvas (fn [blob]
|
||||
(when blob
|
||||
(let [img (js/document.getElementById "export-preview")
|
||||
img-url (image/create-object-url blob)]
|
||||
(set! (.-src img) img-url)
|
||||
(callback blob)))) "image/png")))))))
|
||||
(-> (js/html2canvas container options)
|
||||
(.then (fn [canvas] (.toBlob canvas (fn [blob]
|
||||
(when blob
|
||||
(let [img (js/document.getElementById "export-preview")
|
||||
img-url (image/create-object-url blob)]
|
||||
(set! (.-src img) img-url)
|
||||
(callback blob)))) "image/png"))))))
|
||||
|
||||
(rum/defcs ^:large-vars/cleanup-todo
|
||||
export-blocks < rum/static
|
||||
|
||||
Reference in New Issue
Block a user