aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/DocumentManager.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-11-09 15:04:28 -0500
committerbobzel <zzzman@gmail.com>2020-11-09 15:04:28 -0500
commitce5512a3fdd451ad47263f896a9e855229133eaf (patch)
tree3e6d8bd391b8e465282cac7a5f6912fab0f900ac /src/client/util/DocumentManager.ts
parentaba91357df33b49e9c09208a53b757ef8f8dc724 (diff)
added fullScreen alias option for opening documents so that opened document can have different scale than original. fixed pushpins to not toggle target if something must be panned/zoomed to show the target. fixed drag drop to ignore the document being dragged properly when dropping (which prevented a document over a collection from being dropped on the colelction when move slightly).
Diffstat (limited to 'src/client/util/DocumentManager.ts')
-rw-r--r--src/client/util/DocumentManager.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/client/util/DocumentManager.ts b/src/client/util/DocumentManager.ts
index 14aaeaec0..a6816c7f9 100644
--- a/src/client/util/DocumentManager.ts
+++ b/src/client/util/DocumentManager.ts
@@ -163,21 +163,19 @@ export class DocumentManager {
if (docView) { // we have a docView already and aren't forced to create a new one ... just focus on the document. TODO move into view if necessary otherwise just highlight?
const sameContext = annotatedDoc && annotatedDoc === originatingDoc?.context;
if (originatingDoc?.isPushpin) {
- const hide = !docView.props.Document.hidden;
- docView.props.focus(docView.props.Document, willZoom, undefined, (notfocused: boolean) => { // bcz: Argh! TODO: Need to add a notFocused argument to the after finish callback function that indicates whether the window had to scroll to show the target
- if (notfocused || docView.props.Document.hidden) {
+ docView.props.focus(docView.props.Document, willZoom, undefined, (didFocus: boolean) => {
+ if (!didFocus || docView.props.Document.hidden) {
docView.props.Document.hidden = !docView.props.Document.hidden;
}
return focusAndFinish();
- // @ts-ignore bcz: Argh TODO: Need to add a parameter to focus() everywhere for whether focus should center the target's container in the view or not. // here we don't want to focus the container if the source and target are in the same container
- }, sameContext);
+ }, sameContext, false);// don't want to focus the container if the source and target are in the same container, so pass 'sameContext' for dontCenter parameter
//finished?.();
}
else {
docView.select(false);
docView.props.Document.hidden && (docView.props.Document.hidden = undefined);
// @ts-ignore
- docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish, sameContext);
+ docView.props.focus(docView.props.Document, willZoom, undefined, focusAndFinish, sameContext, false);
}
highlight();
} else {