mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Pagescroller - get scroll pos in src window (#3561)
This commit is contained in:
parent
d55a498fca
commit
2541b9b090
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user