diff --git a/bower.json b/bower.json index 8df4d442d..d7b047e8f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.519", + "version": "1.1.521", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index a3a40491c..742662caa 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.519'; -PDFJS.build = 'c4403e6'; +PDFJS.version = '1.1.521'; +PDFJS.build = 'b48512f'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.js b/build/pdf.js index edb48e793..398e6baec 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.519'; -PDFJS.build = 'c4403e6'; +PDFJS.version = '1.1.521'; +PDFJS.build = 'b48512f'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 82f637079..05dbe728f 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.519'; -PDFJS.build = 'c4403e6'; +PDFJS.version = '1.1.521'; +PDFJS.build = 'b48512f'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/package.json b/package.json index 4e915ef79..9002a6c56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.519", + "version": "1.1.521", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla", diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index 58ab29cd8..632ff83c3 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -125,11 +125,13 @@ function getOutputScale(ctx) { /** * Scrolls specified element into view of its parent. - * element {Object} The element to be visible. - * spot {Object} An object with optional top and left properties, - * specifying the offset from the top left edge. + * @param {Object} element - The element to be visible. + * @param {Object} spot - An object with optional top and left properties, + * specifying the offset from the top left edge. + * @param {boolean} skipOverflowHiddenElements - Ignore elements that have + * the CSS rule `overflow: hidden;` set. The default is false. */ -function scrollIntoView(element, spot) { +function scrollIntoView(element, spot, skipOverflowHiddenElements) { // Assuming offsetParent is available (it's not available when viewer is in // hidden iframe or object). We have to scroll: if the offsetParent is not set // producing the error. See also animationStartedClosure. @@ -138,10 +140,11 @@ function scrollIntoView(element, spot) { console.error('offsetParent is not set -- cannot scroll'); return; } + var checkOverflow = skipOverflowHiddenElements || false; var offsetY = element.offsetTop + element.clientTop; var offsetX = element.offsetLeft + element.clientLeft; while (parent.clientHeight === parent.scrollHeight || - getComputedStyle(parent).overflow === 'hidden') { + (checkOverflow && getComputedStyle(parent).overflow === 'hidden')) { if (parent.dataset._scaleY) { offsetY /= parent.dataset._scaleY; offsetX /= parent.dataset._scaleX;