mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 08:18:32 +02:00
♻️ Replace frontend transit ns usage with common transit.
This commit is contained in:
parent
2ec769981a
commit
068c94da4e
18 changed files with 43 additions and 179 deletions
|
@ -7,9 +7,9 @@
|
|||
(ns app.util.dom.dnd
|
||||
"Drag & Drop interop helpers."
|
||||
(:require
|
||||
[cuerdas.core :as str]
|
||||
[app.common.transit :as t]
|
||||
[app.util.data :refer (read-string)]
|
||||
[app.util.transit :as t]))
|
||||
[cuerdas.core :as str]))
|
||||
|
||||
;; This is the official documentation for the dnd API:
|
||||
;; https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
|
||||
|
@ -59,7 +59,7 @@
|
|||
(let [dt (.-dataTransfer e)]
|
||||
(if (or (str/starts-with? data-type "application")
|
||||
(str/starts-with? data-type "penpot"))
|
||||
(.setData dt data-type (t/encode data))
|
||||
(.setData dt data-type (t/encode-str data))
|
||||
(.setData dt data-type data))
|
||||
e)))
|
||||
|
||||
|
@ -112,7 +112,7 @@
|
|||
(let [dt (.-dataTransfer e)]
|
||||
(if (or (str/starts-with? data-type "penpot")
|
||||
(= data-type "application/json"))
|
||||
(t/decode (.getData dt data-type))
|
||||
(t/decode-str (.getData dt data-type))
|
||||
(.getData dt data-type)))))
|
||||
|
||||
(defn get-files
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue