Commit 915a1a46 authored by alexandrec's avatar alexandrec Committed by Commit bot

Remove toolbar offset in Material Design PDF Viewer

Review URL: https://codereview.chromium.org/885733003

Cr-Commit-Position: refs/heads/master@{#314987}
parent 7b20d888
......@@ -52,8 +52,9 @@ paper-progress::shadow #progressContainer {
}
#plugin {
height: 100%;
position: fixed;
top: 56px;
width: 100%;
z-index: 1;
}
......
......@@ -86,7 +86,6 @@ function PDFViewer(streamDetails) {
this.passwordScreen_.addEventListener('password-submitted',
this.onPasswordSubmitted_.bind(this));
this.errorScreen_ = $('error-screen');
this.toolbarHeight_ = this.isMaterial_ ? $('pdf-toolbar').clientHeight : 0;
this.bookmarksPane = $('bookmarks-pane');
// Create the viewport.
......@@ -95,8 +94,7 @@ function PDFViewer(streamDetails) {
this.viewportChanged_.bind(this),
this.beforeZoom_.bind(this),
this.afterZoom_.bind(this),
getScrollbarWidth(),
this.toolbarHeight_);
getScrollbarWidth());
// Create the plugin object dynamically so we can set its src. The plugin
// element is sized to fill the entire window and is set to be fixed
// positioning, acting as a viewport. The plugin renders into this viewport
......
......@@ -24,15 +24,13 @@ function getIntersectionHeight(rect1, rect2) {
* @param {Function} beforeZoomCallback is run before a change in zoom
* @param {Function} afterZoomCallback is run after a change in zoom
* @param {number} scrollbarWidth the width of scrollbars on the page
* @param {number} yPos the offset of the viewport from the top of the window
*/
function Viewport(window,
sizer,
viewportChangedCallback,
beforeZoomCallback,
afterZoomCallback,
scrollbarWidth,
yPos) {
scrollbarWidth) {
this.window_ = window;
this.sizer_ = sizer;
this.viewportChangedCallback_ = viewportChangedCallback;
......@@ -44,7 +42,6 @@ function Viewport(window,
this.pageDimensions_ = [];
this.scrollbarWidth_ = scrollbarWidth;
this.fittingType_ = Viewport.FittingType.NONE;
this.yPos = yPos;
window.addEventListener('scroll', this.updateViewport_.bind(this));
window.addEventListener('resize', this.resize_.bind(this));
......@@ -140,7 +137,7 @@ Viewport.prototype = {
this.sizer_.style.width =
this.documentDimensions_.width * this.zoom_ + 'px';
this.sizer_.style.height =
this.documentDimensions_.height * this.zoom_ + this.yPos + 'px';
this.documentDimensions_.height * this.zoom_ + 'px';
}
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment