aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-03-12 11:03:19 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-03-12 11:03:19 -0400
commitae8bc0f99f35f6c72aaa9be3f5617d54ba64299b (patch)
treead6773cf6bfa98a75734d965b36626879c2cd719
parent1b2eac89b8f88358ecf1ba0e782c90379090b9c8 (diff)
Fixes
-rw-r--r--package-lock.json8
-rw-r--r--src/client/views/collections/CollectionFreeFormView.tsx1
-rw-r--r--src/client/views/collections/CollectionViewBase.tsx16
3 files changed, 8 insertions, 17 deletions
diff --git a/package-lock.json b/package-lock.json
index dd5d44bd9..5b9cb598d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3735,12 +3735,14 @@
"balanced-match": {
"version": "1.0.0",
"resolved": false,
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
+ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"resolved": false,
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -3760,7 +3762,8 @@
"concat-map": {
"version": "0.0.1",
"resolved": false,
- "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
@@ -3908,6 +3911,7 @@
"version": "3.0.4",
"resolved": false,
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
diff --git a/src/client/views/collections/CollectionFreeFormView.tsx b/src/client/views/collections/CollectionFreeFormView.tsx
index 761c3ba56..ab41d1378 100644
--- a/src/client/views/collections/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/CollectionFreeFormView.tsx
@@ -116,6 +116,7 @@ export class CollectionFreeFormView extends CollectionViewBase {
@action
cleanupInteractions = () => {
+ document.removeEventListener("keydown", this.marqueeCommand);
document.removeEventListener("pointermove", this.onPointerMove);
document.removeEventListener("pointerup", this.onPointerUp);
this._marquee = false;
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx
index a77133e6c..b581d3060 100644
--- a/src/client/views/collections/CollectionViewBase.tsx
+++ b/src/client/views/collections/CollectionViewBase.tsx
@@ -82,21 +82,7 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps>
const upload = window.location.origin + "/upload";
let item = e.dataTransfer.items[i];
if (item.kind === "string" && item.type.indexOf("uri") != -1) {
- e.dataTransfer.items[i].getAsString(function (s) {
- action(() => {
- var img = Documents.ImageDocument(s, { ...options, nativeWidth: 300, width: 300, })
-
- let docs = that.props.Document.GetT(KeyStore.Data, ListField);
- if (docs != FieldWaiting) {
- if (!docs) {
- docs = new ListField<Document>();
- that.props.Document.Set(KeyStore.Data, docs)
- }
- docs.Data.push(img);
- }
- })()
-
- })
+ e.dataTransfer.items[i].getAsString(action((s: string) => this.props.addDocument(Documents.WebDocument(s, options))))
}
let type = item.type
console.log(type)