diff options
-rw-r--r-- | src/client/util/DragManager.ts | 51 | ||||
-rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingBox.tsx | 2 |
2 files changed, 0 insertions, 53 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts index 6c0641943..4ab033555 100644 --- a/src/client/util/DragManager.ts +++ b/src/client/util/DragManager.ts @@ -236,57 +236,6 @@ export namespace DragManager { return true; } - export function StartDropdownDrag(eles: HTMLElement[], dragData: DocumentDragData, downX: number, downY: number, recordingIndex: number, options?: DragOptions, dropEvent?: () => any) { - const addAudioTag = (dropDoc: any) => { - dropDoc && !dropDoc.author_date && (dropDoc.author_date = new DateField()); - dropDoc instanceof Doc && DocUtils.MakeLinkToActiveAudio(() => dropDoc); - return dropDoc; - }; - const finishDrag = async (e: DragCompleteEvent) => { - Doc.RemFromMyOverlay(DocCast(Doc.UserDoc().currentRecording)); - Doc.UserDoc().currentRecording = undefined; - Doc.UserDoc().isWorkspaceReplaying = false; - Doc.UserDoc().workspaceRecordingState = undefined; - Cast(Doc.UserDoc().workspaceRecordings, listSpec(Doc), null)?.splice(recordingIndex, 1); - const docDragData = e.docDragData; - dropEvent?.(); // glr: optional additional function to be called - in this case with presentation trails - if (docDragData && !docDragData.droppedDocuments.length) { - docDragData.dropAction = dragData.userDropAction || dragData.dropAction; - docDragData.droppedDocuments = ( - await Promise.all( - dragData.draggedDocuments.map(async d => - !dragData.isDocDecorationMove && !dragData.userDropAction && ScriptCast(d.onDragStart) - ? addAudioTag(ScriptCast(d.onDragStart).script.run({ this: d }).result) - : docDragData.dropAction === 'embed' - ? Doc.BestEmbedding(d) - : docDragData.dropAction === 'add' - ? d - : docDragData.dropAction === 'proto' - ? Doc.GetProto(d) - : docDragData.dropAction === 'copy' - ? ( - await Doc.MakeClone(d) - ).clone - : d - ) - ) - ).filter(d => d); - !['same', 'proto'].includes(docDragData.dropAction as any) && - docDragData.droppedDocuments - // .filter(drop => !drop.dragOnlyWithinContainer || ['embed', 'copy'].includes(docDragData.dropAction as any)) - .forEach((drop: Doc, i: number) => { - const dragProps = StrListCast(dragData.draggedDocuments[i].dropPropertiesToRemove); - const remProps = (dragData?.dropPropertiesToRemove || []).concat(Array.from(dragProps)); - [...remProps, 'dropPropertiesToRemove'].map(prop => (drop[prop] = undefined)); - }); - } - return e; - }; - dragData.draggedDocuments.map(d => d.dragFactory); // does this help? trying to make sure the dragFactory Doc is loaded - StartDrag(eles, dragData, downX, downY, options, finishDrag); - return true; - } - // drag a button template and drop a new button export function StartButtonDrag(eles: HTMLElement[], script: string, title: string, vars: { [name: string]: Field }, params: string[], initialize: (button: Doc) => void, downX: number, downY: number, options?: DragOptions) { const finishDrag = (e: DragCompleteEvent) => { diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx index b1b044c25..1b2f63fa2 100644 --- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx @@ -120,8 +120,6 @@ export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() { SelectionManager.SelectSchemaViewDoc(value); RecordingBox.resumeWorkspaceReplaying(value); }); - // let recordingIndex = DocListCast(Doc.UserDoc().workspaceRecordings).indexOf(value); - // DragManager.StartDropdownDrag([document.createElement('div')], new DragManager.DocumentDragData([value]), 1, 1, recordingIndex); } /** |