aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2019-09-20 15:11:30 -0400
committerbobzel <zzzman@gmail.com>2019-09-20 15:11:30 -0400
commit6f7936d5c71bf3c802d73f47b19abe96c6d61848 (patch)
tree266d2f5f47bdde960656a5a14888b7bba09fac62 /src/client/views/pdf
parent2a003f69f8b5323c2a6b244332b1511df1ef0cc1 (diff)
simplified script execution api a little. fixed dataDoc() related stuff in various Box's. fixed some template stuff.
Diffstat (limited to 'src/client/views/pdf')
-rw-r--r--src/client/views/pdf/PDFAnnotationLayer.scss6
-rw-r--r--src/client/views/pdf/PDFAnnotationLayer.tsx21
-rw-r--r--src/client/views/pdf/PDFViewer.tsx17
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 }
);