Merge pull request #6257 from timvandermeij/viewer-cleanup
Remove unused globals and updateViewarea function from viewer.js
This commit is contained in:
commit
45810e0866
@ -20,10 +20,10 @@
|
|||||||
PDFThumbnailViewer, URL, noContextMenuHandler, SecondaryToolbar,
|
PDFThumbnailViewer, URL, noContextMenuHandler, SecondaryToolbar,
|
||||||
PasswordPrompt, PDFPresentationMode, PDFDocumentProperties, HandTool,
|
PasswordPrompt, PDFPresentationMode, PDFDocumentProperties, HandTool,
|
||||||
Promise, PDFLinkService, PDFOutlineView, PDFAttachmentView,
|
Promise, PDFLinkService, PDFOutlineView, PDFAttachmentView,
|
||||||
OverlayManager, PDFFindController, PDFFindBar, getVisibleElements,
|
OverlayManager, PDFFindController, PDFFindBar, PDFViewer,
|
||||||
watchScroll, PDFViewer, PDFRenderingQueue, PresentationModeState,
|
PDFRenderingQueue, PresentationModeState, parseQueryString,
|
||||||
parseQueryString, RenderingStates, UNKNOWN_SCALE,
|
RenderingStates, UNKNOWN_SCALE, DEFAULT_SCALE_VALUE,
|
||||||
DEFAULT_SCALE_VALUE, IGNORE_CURRENT_POSITION_ON_ZOOM: true */
|
IGNORE_CURRENT_POSITION_ON_ZOOM: true */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
@ -1591,13 +1591,6 @@ window.addEventListener('presentationmodechanged', function (e) {
|
|||||||
active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL;
|
active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL;
|
||||||
});
|
});
|
||||||
|
|
||||||
function updateViewarea() {
|
|
||||||
if (!PDFViewerApplication.initialized) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
PDFViewerApplication.pdfViewer.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener('updateviewarea', function (evt) {
|
window.addEventListener('updateviewarea', function (evt) {
|
||||||
if (!PDFViewerApplication.initialized) {
|
if (!PDFViewerApplication.initialized) {
|
||||||
return;
|
return;
|
||||||
@ -1650,8 +1643,8 @@ window.addEventListener('resize', function webViewerResize(evt) {
|
|||||||
// (E.g. the document being rendered with the wrong scale on load.)
|
// (E.g. the document being rendered with the wrong scale on load.)
|
||||||
PDFViewerApplication.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;
|
PDFViewerApplication.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE;
|
||||||
}
|
}
|
||||||
|
PDFViewerApplication.pdfViewer.update();
|
||||||
}
|
}
|
||||||
updateViewarea();
|
|
||||||
|
|
||||||
// Set the 'max-height' CSS property of the secondary toolbar.
|
// Set the 'max-height' CSS property of the secondary toolbar.
|
||||||
SecondaryToolbar.setMaxHeight(document.getElementById('viewerContainer'));
|
SecondaryToolbar.setMaxHeight(document.getElementById('viewerContainer'));
|
||||||
@ -1759,7 +1752,10 @@ window.addEventListener('scalechange', function scalechange(evt) {
|
|||||||
mozL10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%');
|
mozL10n.get('page_scale_percent', { scale: customScale }, '{{scale}}%');
|
||||||
customScaleOption.selected = true;
|
customScaleOption.selected = true;
|
||||||
}
|
}
|
||||||
updateViewarea();
|
if (!PDFViewerApplication.initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
PDFViewerApplication.pdfViewer.update();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
window.addEventListener('pagechange', function pagechange(evt) {
|
window.addEventListener('pagechange', function pagechange(evt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user