diff options
| author | bobzel <zzzman@gmail.com> | 2020-09-28 13:00:55 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2020-09-28 13:00:55 -0400 |
| commit | 9d9e7593a0ece66d3538ea5986de3388a0759ad7 (patch) | |
| tree | 4f8c36a2134dfaebd0c80bf7a31178233c39713c /src/client/views/pdf/Annotation.tsx | |
| parent | 22dae4786350f515d801e2128390587075617fe5 (diff) | |
fixed filtering annotation anchors on PDFs. added tooltip for identifying who made an annotation.
Diffstat (limited to 'src/client/views/pdf/Annotation.tsx')
| -rw-r--r-- | src/client/views/pdf/Annotation.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/views/pdf/Annotation.tsx b/src/client/views/pdf/Annotation.tsx index f680a00df..33c7bd4f3 100644 --- a/src/client/views/pdf/Annotation.tsx +++ b/src/client/views/pdf/Annotation.tsx @@ -1,7 +1,7 @@ import React = require("react"); import { action, IReactionDisposer, observable, reaction, runInAction } from "mobx"; import { observer } from "mobx-react"; -import { Doc, DocListCast, HeightSym, WidthSym } from "../../../fields/Doc"; +import { Doc, DocListCast, HeightSym, WidthSym, Field } from "../../../fields/Doc"; import { Id } from "../../../fields/FieldSymbols"; import { List } from "../../../fields/List"; import { Cast, FieldValue, BoolCast, NumCast, StrCast, PromiseValue } from "../../../fields/Types"; @@ -9,6 +9,7 @@ import { DocumentManager } from "../../util/DocumentManager"; import { PDFMenu } from "./PDFMenu"; import "./Annotation.scss"; import { undoBatch } from "../../util/UndoManager"; +import { useIsFocusVisible } from "@material-ui/core"; interface IAnnotationProps { anno: Doc; @@ -128,8 +129,9 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> { return false; } + @observable _showInfo = false; render() { - return (<div className="pdfAnnotation" onPointerDown={this.onPointerDown} ref={this._mainCont} + return (<div className="pdfAnnotation" onPointerEnter={action(() => this._showInfo = true)} onPointerLeave={action(() => this._showInfo = false)} onPointerDown={this.onPointerDown} ref={this._mainCont} style={{ top: this.props.y, left: this.props.x, @@ -137,7 +139,10 @@ class RegionAnnotation extends React.Component<IRegionAnnotationProps> { height: this.props.height, opacity: this._brushed ? 0.5 : undefined, backgroundColor: this._brushed ? "orange" : StrCast(this.props.document.backgroundColor), - transition: "opacity 0.5s", - }} />); + }} > + {!this._showInfo ? (null) : <div className="pdfAnnotation-info"> + {this.props.dataDoc.author + " " + Field.toString(this.props.dataDoc.creationDate as Field)} + </div>} + </div>); } }
\ No newline at end of file |
