diff options
| author | yipstanley <stanley_yip@brown.edu> | 2019-03-17 19:27:48 -0400 |
|---|---|---|
| committer | yipstanley <stanley_yip@brown.edu> | 2019-03-17 19:27:48 -0400 |
| commit | 65d67baa79c7d1c22db23b4ea722403d5067176b (patch) | |
| tree | 2bccce4ca89dce2329d791486b3173d79c4390ff /src/client/views/collections/CollectionViewBase.tsx | |
| parent | 94baa241afd3a99b233ae6197b7e404951347413 (diff) | |
| parent | 641656b5e803305971006c386db2f465da0373ac (diff) | |
changes
Diffstat (limited to 'src/client/views/collections/CollectionViewBase.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionViewBase.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionViewBase.tsx b/src/client/views/collections/CollectionViewBase.tsx index eda62a4ca..d9598aa72 100644 --- a/src/client/views/collections/CollectionViewBase.tsx +++ b/src/client/views/collections/CollectionViewBase.tsx @@ -47,6 +47,7 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps> protected drop(e: Event, de: DragManager.DropEvent) { const docView: DocumentView = de.data["documentView"]; const doc: Document = de.data["document"]; + if (docView && (!docView.props.ContainingCollectionView || docView.props.ContainingCollectionView !== this.props.CollectionView)) { if (docView.props.RemoveDocument) { docView.props.RemoveDocument(docView.props.Document); @@ -61,12 +62,17 @@ export class CollectionViewBase extends React.Component<SubCollectionViewProps> @action protected onDrop(e: React.DragEvent, options: DocumentOptions): void { - e.stopPropagation() - e.preventDefault() let that = this; let html = e.dataTransfer.getData("text/html"); let text = e.dataTransfer.getData("text/plain"); + + if (text && text.startsWith("<div")) { + return; + } + e.stopPropagation() + e.preventDefault() + if (html && html.indexOf("<img") != 0) { console.log("not good"); let htmlDoc = Documents.HtmlDocument(html, { ...options, width: 300, height: 300 }); |
