diff options
| author | bobzel <zzzman@gmail.com> | 2021-02-14 21:48:55 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2021-02-14 21:48:55 -0500 |
| commit | 4ef4d06413169971a3919aa0c935eb321be7288b (patch) | |
| tree | c2cd7ba6ad4321b30ef9865134d91b4131fdffe9 /src/client/views/collections/CollectionStackingView.tsx | |
| parent | 6fcef3d8dfdbe373724d2f11c9df8f350bd8950c (diff) | |
fixed freeformview focus to not pan annotation documents or layoutEngine freeform views. fixed some exceptions. cleaned up focus() return value.
Diffstat (limited to 'src/client/views/collections/CollectionStackingView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionStackingView.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 1d6112745..0ac1cdb28 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -21,7 +21,7 @@ import { ContextMenu } from "../ContextMenu"; import { ContextMenuProps } from "../ContextMenuItem"; import { EditableView } from "../EditableView"; import { CollectionFreeFormDocumentView } from "../nodes/CollectionFreeFormDocumentView"; -import { DocumentView, DocumentViewProps, DocFocusOptions } from "../nodes/DocumentView"; +import { DocumentView, DocumentViewProps, DocFocusOptions, ViewAdjustment } from "../nodes/DocumentView"; import { FieldViewProps } from "../nodes/FieldView"; import { StyleProp } from "../StyleProvider"; import { CollectionMasonryViewFieldRow } from "./CollectionMasonryViewFieldRow"; @@ -181,10 +181,10 @@ export class CollectionStackingView extends CollectionSubView<StackingDocument, smoothScroll(focusSpeed = doc.presTransition || doc.presTransition === 0 ? NumCast(doc.presTransition) : 500, this._mainCont!, localTop[1] + this._mainCont!.scrollTop); } } - const endFocus = async (moved: boolean) => options?.afterFocus ? options?.afterFocus(moved) : false; + const endFocus = async (moved: boolean) => options?.afterFocus ? options?.afterFocus(moved) : ViewAdjustment.doNothing; this.props.focus(this.rootDoc, { willZoom: options?.willZoom, scale: options?.scale, afterFocus: (didFocus: boolean) => - new Promise<boolean>(res => setTimeout(async () => res(await endFocus(didFocus)), focusSpeed)) + new Promise<ViewAdjustment>(res => setTimeout(async () => res(await endFocus(didFocus)), focusSpeed)) }); } |
