Merge pull request #11388 from Snuffleupagus/rm-PDFPresentationMode-viewer-option
Remove the `viewer` option from the `PDFPresentationMode` constructor
This commit is contained in:
		
						commit
						7b503c8923
					
				| @ -368,7 +368,6 @@ let PDFViewerApplication = { | |||||||
|     if (this.supportsFullscreen) { |     if (this.supportsFullscreen) { | ||||||
|       this.pdfPresentationMode = new PDFPresentationMode({ |       this.pdfPresentationMode = new PDFPresentationMode({ | ||||||
|         container, |         container, | ||||||
|         viewer, |  | ||||||
|         pdfViewer: this.pdfViewer, |         pdfViewer: this.pdfViewer, | ||||||
|         eventBus, |         eventBus, | ||||||
|         contextMenuItems: appConfig.fullscreen, |         contextMenuItems: appConfig.fullscreen, | ||||||
|  | |||||||
| @ -32,7 +32,6 @@ const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; | |||||||
| /** | /** | ||||||
|  * @typedef {Object} PDFPresentationModeOptions |  * @typedef {Object} PDFPresentationModeOptions | ||||||
|  * @property {HTMLDivElement} container - The container for the viewer element. |  * @property {HTMLDivElement} container - The container for the viewer element. | ||||||
|  * @property {HTMLDivElement} [viewer] - The viewer element. |  | ||||||
|  * @property {PDFViewer} pdfViewer - The document viewer. |  * @property {PDFViewer} pdfViewer - The document viewer. | ||||||
|  * @property {EventBus} eventBus - The application event bus. |  * @property {EventBus} eventBus - The application event bus. | ||||||
|  * @property {Array} [contextMenuItems] - The menu items that are added to the |  * @property {Array} [contextMenuItems] - The menu items that are added to the | ||||||
| @ -43,10 +42,8 @@ class PDFPresentationMode { | |||||||
|   /** |   /** | ||||||
|    * @param {PDFPresentationModeOptions} options |    * @param {PDFPresentationModeOptions} options | ||||||
|    */ |    */ | ||||||
|   constructor({ container, viewer = null, pdfViewer, eventBus, |   constructor({ container, pdfViewer, eventBus, contextMenuItems = null, }) { | ||||||
|                 contextMenuItems = null, }) { |  | ||||||
|     this.container = container; |     this.container = container; | ||||||
|     this.viewer = viewer || container.firstElementChild; |  | ||||||
|     this.pdfViewer = pdfViewer; |     this.pdfViewer = pdfViewer; | ||||||
|     this.eventBus = eventBus; |     this.eventBus = eventBus; | ||||||
| 
 | 
 | ||||||
| @ -82,7 +79,7 @@ class PDFPresentationMode { | |||||||
|    * @returns {boolean} Indicating if the request was successful. |    * @returns {boolean} Indicating if the request was successful. | ||||||
|    */ |    */ | ||||||
|   request() { |   request() { | ||||||
|     if (this.switchInProgress || this.active || !this.viewer.hasChildNodes()) { |     if (this.switchInProgress || this.active || !this.pdfViewer.pagesCount) { | ||||||
|       return false; |       return false; | ||||||
|     } |     } | ||||||
|     this._addFullscreenChangeListeners(); |     this._addFullscreenChangeListeners(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user