diff options
| author | kimdahey <claire_kim1@brown.edu> | 2019-08-26 10:59:12 -0400 |
|---|---|---|
| committer | kimdahey <claire_kim1@brown.edu> | 2019-08-26 10:59:12 -0400 |
| commit | 0bc71503ed58bc07a9e96eae31857b612caa2f24 (patch) | |
| tree | 07f1fdfbb648c6fcdbf7bd7add8854f5c2c1a4d7 /src/client/views/nodes | |
| parent | ad5def13620e361990423253e113d2c3104f5668 (diff) | |
| parent | 939074601016a674d6a01922bab1383684fce63f (diff) | |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into doc_deco_claire
Diffstat (limited to 'src/client/views/nodes')
| -rw-r--r-- | src/client/views/nodes/FormattedTextBox.tsx | 10 | ||||
| -rw-r--r-- | src/client/views/nodes/ImageBox.scss | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index 6a922d3d6..41344cf50 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -36,6 +36,7 @@ import { GoogleApiClientUtils, Pulls, Pushes } from '../../apis/google_docs/Goog import { DocumentDecorations } from '../DocumentDecorations'; import { DictationManager } from '../../util/DictationManager'; import { ReplaceStep } from 'prosemirror-transform'; +import { DocumentType } from '../../documents/DocumentTypes'; library.add(faEdit); library.add(faSmile, faTextHeight, faUpload); @@ -318,10 +319,11 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe let model: NodeType = (url.includes(".mov") || url.includes(".mp4")) ? schema.nodes.video : schema.nodes.image; this._editorView!.dispatch(this._editorView!.state.tr.insert(0, model.create({ src: url }))); e.stopPropagation(); - } else { - if (de.data instanceof DragManager.DocumentDragData) { - this.props.Document.layout = de.data.draggedDocuments[0]; - de.data.draggedDocuments[0].isTemplate = true; + } else if (de.data instanceof DragManager.DocumentDragData) { + const draggedDoc = de.data.draggedDocuments.length && de.data.draggedDocuments[0]; + if (draggedDoc && draggedDoc.type === DocumentType.TEXT && StrCast(draggedDoc.layout) !== "") { + this.props.Document.layout = draggedDoc; + draggedDoc.isTemplate = true; e.stopPropagation(); } } diff --git a/src/client/views/nodes/ImageBox.scss b/src/client/views/nodes/ImageBox.scss index b1afa3f7d..00c069e1f 100644 --- a/src/client/views/nodes/ImageBox.scss +++ b/src/client/views/nodes/ImageBox.scss @@ -65,6 +65,7 @@ display:flex; align-items: center; height:100%; + overflow:hidden; .imageBox-fadeBlocker { width:100%; height:100%; |
