mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Add scrolling modes to web viewer
In addition to the default scrolling mode (vertical), this commit adds horizontal and wrapped scrolling, implemented primarily with CSS.
This commit is contained in:
parent
65c8549759
commit
91cbc185da
17 changed files with 665 additions and 27 deletions
|
@ -1385,6 +1385,7 @@ let PDFViewerApplication = {
|
|||
eventBus.on('scalechanged', webViewerScaleChanged);
|
||||
eventBus.on('rotatecw', webViewerRotateCw);
|
||||
eventBus.on('rotateccw', webViewerRotateCcw);
|
||||
eventBus.on('switchscrollmode', webViewerSwitchScrollMode);
|
||||
eventBus.on('documentproperties', webViewerDocumentProperties);
|
||||
eventBus.on('find', webViewerFind);
|
||||
eventBus.on('findfromurlhash', webViewerFindFromUrlHash);
|
||||
|
@ -1451,6 +1452,7 @@ let PDFViewerApplication = {
|
|||
eventBus.off('scalechanged', webViewerScaleChanged);
|
||||
eventBus.off('rotatecw', webViewerRotateCw);
|
||||
eventBus.off('rotateccw', webViewerRotateCcw);
|
||||
eventBus.off('switchscrollmode', webViewerSwitchScrollMode);
|
||||
eventBus.off('documentproperties', webViewerDocumentProperties);
|
||||
eventBus.off('find', webViewerFind);
|
||||
eventBus.off('findfromurlhash', webViewerFindFromUrlHash);
|
||||
|
@ -1960,6 +1962,9 @@ function webViewerRotateCw() {
|
|||
function webViewerRotateCcw() {
|
||||
PDFViewerApplication.rotatePages(-90);
|
||||
}
|
||||
function webViewerSwitchScrollMode(evt) {
|
||||
PDFViewerApplication.pdfViewer.setScrollMode(evt.mode);
|
||||
}
|
||||
function webViewerDocumentProperties() {
|
||||
PDFViewerApplication.pdfDocumentProperties.open();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue