mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-13 03:35:37 +02:00
This implements a new Page scrolling mode, essentially bringing (and extending) the functionality from `PDFSinglePageViewer` into the regular `PDFViewer`-class. Compared to `PDFSinglePageViewer`, which as its name suggests will only display one page at a time, in the `PDFViewer`-implementation this new Page scrolling mode also support spreadModes properly (somewhat similar to e.g. Adobe Reader). Given the size and scope of these changes, I've tried to focus on implementing the basic functionality. Hence there's room for further clean-up and/or improvements, including e.g. simplifying the CSS/JS related to PresentationMode and implementing easier page-switching with the mouse-wheel/arrow-keys.
37 lines
1.1 KiB
JavaScript
37 lines
1.1 KiB
JavaScript
/* Copyright 2017 Mozilla Foundation
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
import { ScrollMode, SpreadMode } from "./ui_utils.js";
|
|
import { BaseViewer } from "./base_viewer.js";
|
|
|
|
class PDFSinglePageViewer extends BaseViewer {
|
|
_resetView() {
|
|
super._resetView();
|
|
this._scrollMode = ScrollMode.PAGE;
|
|
this._spreadMode = SpreadMode.NONE;
|
|
}
|
|
|
|
// eslint-disable-next-line accessor-pairs
|
|
set scrollMode(mode) {}
|
|
|
|
_updateScrollMode() {}
|
|
|
|
// eslint-disable-next-line accessor-pairs
|
|
set spreadMode(mode) {}
|
|
|
|
_updateSpreadMode() {}
|
|
}
|
|
|
|
export { PDFSinglePageViewer };
|