From d3e66a67406447682c59045a0130d884fe1045a6 Mon Sep 17 00:00:00 2001 From: bob Date: Fri, 8 Mar 2019 13:03:57 -0500 Subject: bug fixes and hack to make context menu appear again --- src/client/views/collections/CollectionPDFView.tsx | 35 +++++----------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'src/client/views/collections/CollectionPDFView.tsx') diff --git a/src/client/views/collections/CollectionPDFView.tsx b/src/client/views/collections/CollectionPDFView.tsx index 90da43921..7fd9f0f11 100644 --- a/src/client/views/collections/CollectionPDFView.tsx +++ b/src/client/views/collections/CollectionPDFView.tsx @@ -1,20 +1,11 @@ import { action, computed } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; -import { ListField } from "../../../fields/ListField"; -import { SelectionManager } from "../../util/SelectionManager"; -import { ContextMenu } from "../ContextMenu"; -import React = require("react"); import { KeyStore } from "../../../fields/KeyStore"; -import { NumberField } from "../../../fields/NumberField"; -import { CollectionFreeFormView } from "./CollectionFreeFormView"; -import { CollectionDockingView } from "./CollectionDockingView"; -import { CollectionSchemaView } from "./CollectionSchemaView"; +import { ContextMenu } from "../ContextMenu"; +import { CollectionView, CollectionViewType } from "./CollectionView"; import { CollectionViewProps } from "./CollectionViewBase"; -import { CollectionTreeView } from "./CollectionTreeView"; -import { Field } from "../../../fields/Field"; -import { CollectionViewType, CollectionView } from "./CollectionView"; -import { JSXElement } from "babel-types"; +import React = require("react"); @observer @@ -39,30 +30,20 @@ export class CollectionPDFView extends React.Component { ); } - // CollectionView API starts here... + // "inherited" CollectionView API starts here... public active: () => boolean = () => CollectionView.Active(this); - @action - addDocument = (doc: Document): void => { - doc.SetNumber(KeyStore.Page, this.curPage); - CollectionView.AddDocument(this.props, doc); - } - - @action removeDocument = (doc: Document): boolean => { - return CollectionView.RemoveDocument(this.props, doc); - } + addDocument = (doc: Document): void => { CollectionView.AddDocument(this.props, doc); } + removeDocument = (doc: Document): boolean => { return CollectionView.RemoveDocument(this.props, doc); } specificContextMenu = (e: React.MouseEvent): void => { - if (!e.isPropagationStopped) { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7 - ContextMenu.Instance.addItem({ description: "PDFOptions", event: () => { } }) + if (!e.isPropagationStopped() && this.props.Document.Id != "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7 + ContextMenu.Instance.addItem({ description: "PDFOptions", event: () => { } }); } } get collectionViewType(): CollectionViewType { return CollectionViewType.Freeform; } - - - @computed get subView(): any { return CollectionView.SubView(this); } render() { -- cgit v1.2.3-70-g09d2