From e79e53d78546501fc855b76a84f000289ed7433a Mon Sep 17 00:00:00 2001 From: bob Date: Mon, 4 Feb 2019 10:44:30 -0500 Subject: split out common code into CollectionViewBase. organized a few other things, too. --- src/views/nodes/ImageBox.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/views/nodes/ImageBox.tsx') diff --git a/src/views/nodes/ImageBox.tsx b/src/views/nodes/ImageBox.tsx index 7577627e8..5137dbf38 100644 --- a/src/views/nodes/ImageBox.tsx +++ b/src/views/nodes/ImageBox.tsx @@ -2,26 +2,25 @@ import Lightbox from 'react-image-lightbox'; import 'react-image-lightbox/style.css'; // This only needs to be imported once in your app import { SelectionManager } from "../../util/SelectionManager"; -import { DocumentFieldViewProps } from "./DocumentView"; import "./ImageBox.scss"; import React = require("react") import { ImageField } from '../../fields/ImageField'; -import { NumberField } from '../../fields/NumberField'; +import { FieldViewProps } from './FieldView'; interface ImageBoxState { photoIndex: number, isOpen: boolean, }; -export class ImageBox extends React.Component { +export class ImageBox extends React.Component { - public static LayoutString() { return ""; } + public static LayoutString() { return ""; } private _ref: React.RefObject; private _downX: number = 0; private _downY: number = 0; private _lastTap: number = 0; - constructor(props: DocumentFieldViewProps) { + constructor(props: FieldViewProps) { super(props); this._ref = React.createRef(); @@ -39,7 +38,7 @@ export class ImageBox extends React.Component { if (Date.now() - this._lastTap < 300) { - if (e.buttons === 1 && SelectionManager.IsSelected(this.props.containingDocumentView)) { + if (e.buttons === 1 && SelectionManager.IsSelected(this.props.documentViewContainer)) { e.stopPropagation(); this._downX = e.clientX; this._downY = e.clientY; @@ -67,7 +66,7 @@ export class ImageBox extends React.Component { const { photoIndex } = this.state; - if (this.state.isOpen && SelectionManager.IsSelected(this.props.containingDocumentView)) { + if (this.state.isOpen && SelectionManager.IsSelected(this.props.documentViewContainer)) { return (