diff options
| author | tschicke-brown <tyler_schicke@brown.edu> | 2019-03-16 21:54:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-16 21:54:27 -0400 |
| commit | 972d7c28f2f99ee0fa8f0de521e7798edc4fd556 (patch) | |
| tree | 9fcb3eb93fd4048c64c8ddcd9755e9f2d093cd53 /src/client/views/collections/CollectionViewBase.tsx | |
| parent | 0a1b68e534aebf6f5fa6af31fd6a1e3d63f299d1 (diff) | |
| parent | a5a5e17adb4f5881c905baa13669c0ca4e884467 (diff) | |
Merge pull request #60 from browngraphicslab/template
Template
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 }); |
