mirror of
https://github.com/penpot/penpot.git
synced 2025-07-30 02:17:25 +02:00
🐛 Check data type when reading d&d data
This commit is contained in:
parent
04f829eba3
commit
68798522af
1 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
(ns uxbox.util.dom.dnd
|
(ns uxbox.util.dom.dnd
|
||||||
"Drag & Drop interop helpers."
|
"Drag & Drop interop helpers."
|
||||||
(:require
|
(:require
|
||||||
|
[cuerdas.core :as str]
|
||||||
[uxbox.util.data :refer (read-string)]
|
[uxbox.util.data :refer (read-string)]
|
||||||
[uxbox.util.transit :as t]))
|
[uxbox.util.transit :as t]))
|
||||||
|
|
||||||
|
@ -77,7 +78,10 @@
|
||||||
(get-data e "uxbox/data"))
|
(get-data e "uxbox/data"))
|
||||||
([e data-type]
|
([e data-type]
|
||||||
(let [dt (.-dataTransfer e)]
|
(let [dt (.-dataTransfer e)]
|
||||||
(t/decode (.getData dt data-type)))))
|
(if (or (str/starts-with? data-type "uxbox")
|
||||||
|
(= data-type "application/json"))
|
||||||
|
(t/decode (.getData dt data-type))
|
||||||
|
(.getData dt data-type)))))
|
||||||
|
|
||||||
(defn get-files
|
(defn get-files
|
||||||
[e]
|
[e]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue