diff options
| author | mehekj <mehek.jethani@gmail.com> | 2021-09-13 23:05:45 -0400 |
|---|---|---|
| committer | mehekj <mehek.jethani@gmail.com> | 2021-09-13 23:05:45 -0400 |
| commit | ff4350bf1bf7e81d74ef1b369315ca56bcb9ff02 (patch) | |
| tree | 2b05ae2252ba90f4458ed6a5d58ad78404c12c75 /src/client/views/collections | |
| parent | 1ce13f912afc7edd1073e6e8204f8f5fb52cd4b0 (diff) | |
| parent | 4bdd8c4304d0512b69cada37bbed76f3a093e889 (diff) | |
Merge branch 'master' into temporalmedia-mehek
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionStackedTimeline.tsx | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index 2e9525577..8608700aa 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -44,6 +44,8 @@ import { LabelBox } from "../nodes/LabelBox"; import "./CollectionStackedTimeline.scss"; import { Colors } from "../global/globalEnums"; import { DocumentManager } from "../../util/DocumentManager"; +import { SnappingManager } from "../../util/SnappingManager"; +import { DragManager } from "../../util/DragManager"; type PanZoomDocument = makeInterface<[]>; const PanZoomDocument = makeInterface(); @@ -345,6 +347,22 @@ export class CollectionStackedTimeline extends CollectionSubView< ); } + @action + internalDocDrop(e: Event, de: DragManager.DropEvent, docDragData: DragManager.DocumentDragData, xp: number) { + if (!de.embedKey && this.props.layerProvider?.(this.props.Document) !== false && this.props.Document._isGroup) return false; + if (!super.onInternalDrop(e, de)) return false; + + + // determine x coordinate of drop and assign it to the documents being dragged --- see internalDocDrop of collectionFreeFormView.tsx for how it's done when dropping onto a 2D freeform view + + return true; + } + + onInternalDrop = (e: Event, de: DragManager.DropEvent) => { + if (de.complete.docDragData?.droppedDocuments.length) return this.internalDocDrop(e, de, de.complete.docDragData, 0); + return false; + } + @undoBatch @action static createAnchor( @@ -361,6 +379,7 @@ export class CollectionStackedTimeline extends CollectionSubView< title: ComputedField.MakeFunction( `"#" + formatToTime(self["${startTag}"]) + "-" + formatToTime(self["${endTag}"])` ) as any, + _stayInCollection: true, useLinkSmallAnchor: true, hideLinkButton: true, annotationOn: rootDoc, @@ -537,7 +556,7 @@ export class CollectionStackedTimeline extends CollectionSubView< const maxLevel = overlaps.reduce((m, o) => Math.max(m, o.level), 0) + 2; const isActive = this.props.isContentActive() || this.props.isSelected(false); - return ( + return (<div ref={this.createDashEventsTarget} style={{ pointerEvents: SnappingManager.GetIsDragging() ? "all" : undefined }}> <div className="collectionStackedTimeline" ref={(timeline: HTMLDivElement | null) => (this._timeline = timeline)} @@ -646,7 +665,7 @@ export class CollectionStackedTimeline extends CollectionSubView< </> )} </div> - ); + </div>); } } |
