@@ -69,49 +69,6 @@ const CursorTool = {
6969// Used by `PDFViewerApplication`, and by the API unit-tests.
7070const AutoPrintRegExp = / \b p r i n t \s * \( / ;
7171
72- /**
73- * Scrolls specified element into view of its parent.
74- * @param {HTMLElement } element - The element to be visible.
75- * @param {Object } [spot] - An object with optional top and left properties,
76- * specifying the offset from the top left edge.
77- * @param {number } [spot.left]
78- * @param {number } [spot.top]
79- */
80- function scrollIntoView ( element , spot ) {
81- // Assuming offsetParent is available (it's not available when viewer is in
82- // hidden iframe or object). We have to scroll: if the offsetParent is not set
83- // producing the error. See also animationStarted.
84- let parent = element . offsetParent ;
85- if ( ! parent ) {
86- console . error ( "offsetParent is not set -- cannot scroll" ) ;
87- return ;
88- }
89- let offsetY = element . offsetTop + element . clientTop ;
90- let offsetX = element . offsetLeft + element . clientLeft ;
91- while (
92- parent . clientHeight === parent . scrollHeight &&
93- parent . clientWidth === parent . scrollWidth
94- ) {
95- offsetY += parent . offsetTop ;
96- offsetX += parent . offsetLeft ;
97-
98- parent = parent . offsetParent ;
99- if ( ! parent ) {
100- return ; // no need to scroll
101- }
102- }
103- if ( spot ) {
104- if ( spot . top !== undefined ) {
105- offsetY += spot . top ;
106- }
107- if ( spot . left !== undefined ) {
108- offsetX += spot . left ;
109- parent . scrollLeft = offsetX ;
110- }
111- }
112- parent . scrollTop = offsetY ;
113- }
114-
11572/**
11673 * Helper function to start monitoring the scroll event and converting them into
11774 * PDF.js friendly one: with scroll debounce and scroll direction.
@@ -890,7 +847,6 @@ export {
890847 ProgressBar ,
891848 removeNullCharacters ,
892849 SCROLLBAR_PADDING ,
893- scrollIntoView ,
894850 ScrollMode ,
895851 SidebarView ,
896852 SpreadMode ,
0 commit comments