aboutsummaryrefslogtreecommitdiff
path: root/src/client/util
diff options
context:
space:
mode:
authorusodhi <61431818+usodhi@users.noreply.github.com>2020-10-01 01:47:45 +0530
committerusodhi <61431818+usodhi@users.noreply.github.com>2020-10-01 01:47:45 +0530
commit66fa81ccc29b032ce1271cc4cba210d99e0a740d (patch)
tree29aecff86bf2dc25a2dbe9e6b08b8f24ab3b2f15 /src/client/util
parent23c4f10e0bc3d7ec94a5c74df597cdddb23d1413 (diff)
parentf24477e19320ce5055fa5c5e3dd5007d590397a9 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into acls_uv
Diffstat (limited to 'src/client/util')
-rw-r--r--src/client/util/DocumentManager.ts12
-rw-r--r--src/client/util/DragManager.ts3
2 files changed, 5 insertions, 10 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index d7ff03344..2ca29cb7e 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -204,15 +204,9 @@ export class DocumentManager {
};
findView(0);
}
- } else { // there's no context view so we need to create one first and try again
- createViewFunc(targetDocContext); // so first we create the target, but don't pass finished because we still need to create the target
- setTimeout(() => {
- const finalDocView = getFirstDocView(targetDoc);
- const finalDocContextView = getFirstDocView(targetDocContext);
- setTimeout(() => // if not, wait a bit to see if the context can be loaded (e.g., a PDF). wait interval heurisitic tries to guess how we're animating based on what's just become visible
- this.jumpToDocument(targetDoc, willZoom, createViewFunc, undefined, linkDoc, true, undefined, finished), // pass true this time for closeContextIfNotFound
- finalDocView ? 0 : finalDocContextView ? 250 : 2000); // so call jump to doc again and if the doc isn't found, it will be created.
- }, 0);
+ } else { // there's no context view so we need to create one first and try again when that finishes
+ createViewFunc(targetDocContext, // after creating the context, this calls the finish function that will retry looking for the target
+ () => this.jumpToDocument(targetDoc, willZoom, createViewFunc, undefined, linkDoc, true /* if we don't find the target, we want to get rid of the context just created */, undefined, finished));
}
}
}
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index 0169b07fc..3a0f306f3 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -129,6 +129,7 @@ export namespace DragManager {
treeViewDoc?: Doc;
dontHideOnDrop?: boolean;
offset: number[];
+ canEmbed?: boolean;
userDropAction: dropActionType; // the user requested drop action -- this will be honored as specified by modifier keys
defaultDropAction?: dropActionType; // an optionally specified default drop action when there is no user drop actionl - this will be honored if there is no user drop action
dropAction: dropActionType; // a drop action request by the initiating code. the actual drop action may be different -- eg, if the request is 'alias', but the document is dropped within the same collection, the drop action will be switched to 'move'
@@ -324,7 +325,7 @@ export namespace DragManager {
if (dragData.dropAction === "none") return;
const batch = UndoManager.StartBatch("dragging");
eles = eles.filter(e => e);
- CanEmbed = false;
+ CanEmbed = dragData.canEmbed || false;
if (!dragDiv) {
dragDiv = document.createElement("div");
dragDiv.className = "dragManager-dragDiv";