Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- Updated images: moved externally-hosted images into repository, ensured images are vertically centred and displayed as new paragraphs, and cropped images to remove blank space (#8053)

### 🔧 Internal changes
- Updated `pdfjs-dist` to v6.2.108 (#8135)
- Refactored annotation routes to respond with JSON rather than Javascript (#8127)
- Removed `:blob` CSP exception for `img_src` for `groups_controller.rb` and `exam_templates_controller.rb`
- Replaced `jcrop` with `cropperjs` for the exam template cover page crop selector (#8114)
Expand Down
5 changes: 4 additions & 1 deletion app/javascript/Components/Result/pdf_viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export class PDFViewer extends React.PureComponent {
this.pdfViewer = new pdfjsViewer.PDFViewer({
eventBus: this.eventBus,
container: this.pdfContainer.current,
// Text selection conflicts with dragging out annotation regions while grading.
// 0 is TextLayerMode.DISABLE (pdfjsViewer doesn't export the enum).
textLayerMode: this.props.released_to_students ? undefined : 0,
});
window.pdfViewer = this; // For fixing display when pane width changes

Expand Down Expand Up @@ -67,7 +70,7 @@ export class PDFViewer extends React.PureComponent {
}

loadPDFFile = () => {
pdfjs.getDocument(this.props.url).promise.then(pdfDocument => {
pdfjs.getDocument({url: this.props.url}).promise.then(pdfDocument => {
this.pdfViewer.setDocument(pdfDocument);
this.props.setLoadingCallback(false);
});
Expand Down
129 changes: 68 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"marked": "^16.0.0",
"mime": "^4.1.0",
"mousetrap": "^1.6.5",
"pdfjs-dist": "^5.6.205",
"pdfjs-dist": "^6.2.108",
"prismjs": "^1.30.0",
"prop-types": "^15.8.1",
"react": "^19.2.8",
Expand Down