1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Pagescroller - get scroll pos in src window (#3561)

This commit is contained in:
BurningTreeC 2018-11-21 12:32:22 +01:00 committed by Jeremy Ruston
parent d55a498fca
commit 2541b9b090

View File

@ -69,7 +69,7 @@ PageScroller.prototype.scrollIntoView = function(element,callback) {
// Get the client bounds of the element and adjust by the scroll position // Get the client bounds of the element and adjust by the scroll position
var getBounds = function() { var getBounds = function() {
var clientBounds = typeof callback === 'function' ? callback() : element.getBoundingClientRect(), var clientBounds = typeof callback === 'function' ? callback() : element.getBoundingClientRect(),
scrollPosition = $tw.utils.getScrollPosition(); scrollPosition = $tw.utils.getScrollPosition(srcWindow);
return { return {
left: clientBounds.left + scrollPosition.x, left: clientBounds.left + scrollPosition.x,
top: clientBounds.top + scrollPosition.y - offset, top: clientBounds.top + scrollPosition.y - offset,