aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/pdf/PDFViewer.tsx
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/PDFViewer.tsx
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/PDFViewer.tsx')
-rw-r--r--src/client/views/pdf/PDFViewer.tsx17
1 files changed, 4 insertions, 13 deletions
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 }
);