From 2f5051296883d3473e2eb1df648d27a0102d04ed Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 11 Mar 2021 21:48:28 -0500 Subject: fixed display of aliases in filesys tree view. fixed dropping of "proto" dropAction to move, not copy them in file sys. fixed stacking view to allow for a stacking sidebar in PDFs and then properly support fitWidth (and not) for items in the sidebar. --- src/client/views/nodes/PDFBox.tsx | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'src/client/views/nodes/PDFBox.tsx') diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx index 9732fdfb6..a3b5eea0c 100644 --- a/src/client/views/nodes/PDFBox.tsx +++ b/src/client/views/nodes/PDFBox.tsx @@ -3,13 +3,13 @@ import { action, computed, IReactionDisposer, observable, reaction, runInAction import { observer } from "mobx-react"; import * as Pdfjs from "pdfjs-dist"; import "pdfjs-dist/web/pdf_viewer.css"; -import { Doc, Opt, WidthSym } from "../../../fields/Doc"; +import { Doc, Opt, WidthSym, HeightSym } from "../../../fields/Doc"; import { documentSchema } from '../../../fields/documentSchemas'; import { makeInterface } from "../../../fields/Schema"; import { Cast, NumCast, StrCast } from '../../../fields/Types'; import { PdfField } from "../../../fields/URLField"; import { TraceMobx } from '../../../fields/util'; -import { Utils, returnOne, OmitKeys, emptyFunction } from '../../../Utils'; +import { Utils, returnOne, OmitKeys, emptyFunction, returnZero } from '../../../Utils'; import { KeyCodes } from '../../util/KeyCodes'; import { undoBatch } from '../../util/UndoManager'; import { panZoomSchema } from '../collections/collectionFreeForm/CollectionFreeFormView'; @@ -118,25 +118,32 @@ export class PDFBox extends ViewBoxAnnotatableComponent this.fieldKey + "-sidebar"; - sidebarTransform = () => this.props.ScreenToLocalTransform().translate(Doc.NativeWidth(this.dataDoc), 0); - sidebarWidth = () => (NumCast(this.layoutDoc.nativeWidth) - Doc.NativeWidth(this.dataDoc)) * this.props.PanelWidth() / NumCast(this.layoutDoc.nativeWidth); + sidebarTransform = () => this.props.ScreenToLocalTransform().translate(Doc.NativeWidth(this.dataDoc), 0).scale(this.props.scaling?.() || 1); + sidebarWidth = () => !this.layoutDoc._showSidebar ? 0 : (NumCast(this.layoutDoc.nativeWidth) - Doc.NativeWidth(this.dataDoc)) * this.props.PanelWidth() / NumCast(this.layoutDoc.nativeWidth); sidebarAddDocument = (doc: Doc | Doc[]) => this.addDocument(doc, this.sidebarKey()); - sidebarMoveDocument = (doc: Doc | Doc[], targetCollection: Doc, addDocument: (doc: Doc | Doc[]) => boolean) => this.moveDocument(doc, targetCollection, addDocument, this.sidebarKey()); + sidebarMoveDocument = (doc: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (doc: Doc | Doc[]) => boolean) => this.moveDocument(doc, targetCollection, addDocument, this.sidebarKey()); sidebarRemDocument = (doc: Doc | Doc[]) => this.removeDocument(doc, this.sidebarKey()); @computed get sidebarOverlay() { return !this.layoutDoc._showSidebar ? (null) : -
+
+ renderDepth={this.props.renderDepth + 1} + fieldKey={this.sidebarKey()} + pointerEvents={"all"} + />
; } @@ -268,6 +278,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent {this.sidebarOverlay} {this.settingsPanel()} -- cgit v1.2.3-70-g09d2