diff options
Diffstat (limited to 'src/client/views/pdf')
| -rw-r--r-- | src/client/views/pdf/PDFAnnotationLayer.scss | 6 | ||||
| -rw-r--r-- | src/client/views/pdf/PDFAnnotationLayer.tsx | 21 | ||||
| -rw-r--r-- | src/client/views/pdf/PDFViewer.tsx | 17 |
3 files changed, 4 insertions, 40 deletions
diff --git a/src/client/views/pdf/PDFAnnotationLayer.scss b/src/client/views/pdf/PDFAnnotationLayer.scss deleted file mode 100644 index 733533007..000000000 --- a/src/client/views/pdf/PDFAnnotationLayer.scss +++ /dev/null @@ -1,6 +0,0 @@ -.pdfAnnotationLayer-cont { - width:100%; - height:100%; - position:relative; - top:-200%; -}
\ No newline at end of file diff --git a/src/client/views/pdf/PDFAnnotationLayer.tsx b/src/client/views/pdf/PDFAnnotationLayer.tsx deleted file mode 100644 index 4f267a5c0..000000000 --- a/src/client/views/pdf/PDFAnnotationLayer.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import React = require("react"); -import { observer } from "mobx-react"; -import "./PDFAnnotationLayer.scss"; - -interface IAnnotationProps { - -} - -@observer -export class PDFAnnotationLayer extends React.Component { - onPointerDown = (e: React.PointerEvent) => { - if (e.ctrlKey) { - console.log("annotating"); - e.stopPropagation(); - } - } - - render() { - return <div className="pdfAnnotationLayer-cont" onPointerDown={this.onPointerDown} />; - } -}
\ No newline at end of file diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx index 19ef713c2..4afed0b95 100644 --- a/src/client/views/pdf/PDFViewer.tsx +++ b/src/client/views/pdf/PDFViewer.tsx @@ -77,18 +77,12 @@ export class PDFViewer extends React.Component<IViewerProps> { } @computed get allAnnotations() { - let annotations = DocListCast(this.props.fieldExtensionDoc.annotations); - return annotations.filter(anno => { - let run = this._script.run({ this: anno }); - return run.success ? run.result : true; - }); + return DocListCast(this.props.fieldExtensionDoc.annotations).filter( + anno => this._script.run({ this: anno }, console.log, true).result); } @computed get nonDocAnnotations() { - return this._annotations.filter(anno => { - let run = this._script.run({ this: anno }); - return run.success ? run.result : true; - }); + return this._annotations.filter(anno => this._script.run({ this: anno }, console.log, true).result); } componentDidUpdate = (prevProps: IViewerProps) => this.panY !== prevProps.panY && this.renderPages(); @@ -114,10 +108,7 @@ export class PDFViewer extends React.Component<IViewerProps> { if (this._script.originalScript !== oldScript) { this.Index = -1; } - annos.forEach(d => { - let run = this._script.run(d); - d.opacity = !run.success || run.result ? 1 : 0; - }); + annos.forEach(d => d.opacity = this._script.run({ this: d }, console.log, 1).result ? 1 : 0); }), { fireImmediately: true } ); |
