diff options
author | yipstanley <stanley_yip@brown.edu> | 2019-06-14 12:50:55 -0400 |
---|---|---|
committer | yipstanley <stanley_yip@brown.edu> | 2019-06-14 12:50:55 -0400 |
commit | 4818b12510404e7d9cf07b7e872c49d7b752976a (patch) | |
tree | 8c815f134d6909e476bee68db99541b6b0e0c353 /src/client/util/DragManager.ts | |
parent | 94ed67966e7fdc7aa36b1a8b045153d0d661ce57 (diff) | |
parent | 41c290677030cde827c438d9bfda0dbeac64aa14 (diff) |
Merge branch 'pdf_impl' of https://github.com/browngraphicslab/Dash-Web into pdf_impl
Diffstat (limited to 'src/client/util/DragManager.ts')
-rw-r--r-- | src/client/util/DragManager.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index d27396cf3..0fdc6f193 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -4,6 +4,7 @@ import { Cast } from "../../new_fields/Types"; import { emptyFunction } from "../../Utils"; import { CollectionDockingView } from "../views/collections/CollectionDockingView"; import * as globalCssVariables from "../views/globalCssVariables.scss"; +import { URLField } from "../../new_fields/URLField"; import { SelectionManager } from "./SelectionManager"; export type dropActionType = "alias" | "copy" | undefined; @@ -201,10 +202,24 @@ export namespace DragManager { [id: string]: any; } + export class EmbedDragData { + constructor(embeddableSourceDoc: Doc) { + this.embeddableSourceDoc = embeddableSourceDoc; + this.urlField = embeddableSourceDoc.data instanceof URLField ? embeddableSourceDoc.data : undefined; + } + embeddableSourceDoc: Doc; + urlField?: URLField; + [id: string]: any; + } + export function StartLinkDrag(ele: HTMLElement, dragData: LinkDragData, downX: number, downY: number, options?: DragOptions) { StartDrag([ele], dragData, downX, downY, options); } + export function StartEmbedDrag(ele: HTMLElement, dragData: EmbedDragData, downX: number, downY: number, options?: DragOptions) { + StartDrag([ele], dragData, downX, downY, options); + } + export let AbortDrag: () => void = emptyFunction; function StartDrag(eles: HTMLElement[], dragData: { [id: string]: any }, downX: number, downY: number, options?: DragOptions, finishDrag?: (dropData: { [id: string]: any }) => void) { |