aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoryipstanley <stanley_yip@brown.edu>2019-07-02 13:17:00 -0400
committeryipstanley <stanley_yip@brown.edu>2019-07-02 13:17:00 -0400
commitb3bdb02cf0e0f9d9fe00bb2b7e54f5e81d6abf47 (patch)
treec7b1197d29f6caac822d43b3ae8fb7057fb706ab /src
parent49cf949250fb9b01a8457c2c3dee60b19f60c036 (diff)
pdf fix
Diffstat (limited to 'src')
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx3
-rw-r--r--src/client/views/pdf/PDFViewer.tsx37
2 files changed, 40 insertions, 0 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index b1aba10bf..169dbe540 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -195,6 +195,9 @@ export class CollectionFreeFormView extends CollectionSubView(PanZoomDocument) {
// if (!this.props.active()) {
// return;
// }
+ if (this.props.Document.type === "pdf") {
+ return;
+ }
let childSelected = this.childDocs.some(doc => {
var dv = DocumentManager.Instance.getDocumentView(doc);
return dv && SelectionManager.IsSelected(dv) ? true : false;
diff --git a/src/client/views/pdf/PDFViewer.tsx b/src/client/views/pdf/PDFViewer.tsx
index 35bf1c4d7..23a4713d4 100644
--- a/src/client/views/pdf/PDFViewer.tsx
+++ b/src/client/views/pdf/PDFViewer.tsx
@@ -540,6 +540,43 @@ export class Viewer extends React.Component<IViewerProps> {
console.log("rendered");
this._rendered = true;
});
+<<<<<<< Updated upstream
+=======
+ let options = {
+ bar: this._searchCont.current,
+ toggleButton: this._searchToggle.current,
+ findField: this._findField.current,
+ highlightAllCheckbox: this._highlightAll.current,
+ caseSensitiveCheckbox: this._caseSensitivity.current,
+ entireWordCheckbox: this._entireWord.current,
+ findMsg: this._findMsg.current,
+ findResultsCount: this._findResults.current,
+ findPreviousButton: this._previousButton.current,
+ findNextButton: this._nextButton.current,
+ }
+ let findBar = new PDFFindBar.PDFFindBar(options, this._eventBus);
+ this._eventBus.on("find", (evt: any) => {
+ // this._pdfFindController.executeCommand('find', {
+ // query: "the",
+ // phraseSearch: true,
+ // caseSensitive: false,
+ // highlightAll: true,
+ // findPrevious: undefined
+ // });
+ this._pdfFindController.executeCommand('find' + evt.type, {
+ query: evt.query,
+ phraseSearch: evt.phraseSearch,
+ caseSensitive: evt.caseSensitive,
+ entireWord: evt.entireWord,
+ highlightAll: evt.highlightAll,
+ findPrevious: evt.findPrevious
+ });
+ });
+ this._eventBus.on("updatefindcontrolstate", (evt: any) => {
+ // console.log("hello");
+ findBar.updateUIState(evt.state, evt.previous, evt.matchesCount);
+ })
+>>>>>>> Stashed changes
pdfViewer.setDocument(this.props.pdf);
this._pdfFindController = new PDFJSViewer.PDFFindController(pdfViewer);
// this._pdfFindController._linkService = pdfLinkService;