summaryrefslogtreecommitdiffstats
path: root/web/react/utils/utils.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-01-07 21:21:06 -0600
committerCorey Hulen <corey@hulen.com>2016-01-07 21:21:06 -0600
commit3327ae5cf69ba6988470337221ab2f7ea3ec76c8 (patch)
treea1ff50230846cd8bc7b399b5d6b4b6c7ec1e4c26 /web/react/utils/utils.jsx
parent5bcb9f1c50ed9c319d2a21f2ecb4816c51d18b40 (diff)
parent9d9eaec14f4e4a8bc3bda4ef19c980bef2bb467b (diff)
downloadchat-3327ae5cf69ba6988470337221ab2f7ea3ec76c8.tar.gz
chat-3327ae5cf69ba6988470337221ab2f7ea3ec76c8.tar.bz2
chat-3327ae5cf69ba6988470337221ab2f7ea3ec76c8.zip
Merge pull request #1821 from rgarmsen2295/plt-846
PLT-846 Disable the ability to drag and drop text
Diffstat (limited to 'web/react/utils/utils.jsx')
-rw-r--r--web/react/utils/utils.jsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 33aae7d1e..95eca7c3a 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1276,3 +1276,9 @@ export function fillArray(value, length) {
return arr;
}
+
+// Checks if a data transfer contains files not text, folders, etc..
+// Slightly modified from http://stackoverflow.com/questions/6848043/how-do-i-detect-a-file-is-being-dragged-rather-than-a-draggable-element-on-my-pa
+export function isFileTransfer(files) {
+ return files.types != null && (files.types.indexOf ? files.types.indexOf('Files') !== -1 : files.types.contains('application/x-moz-file'));
+}