mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Use srcWindow in scrollable widget (#4677)
This commit is contained in:
parent
d31d4621a4
commit
5b9dbf7b95
@ -68,7 +68,8 @@ Scroll an element into view
|
||||
ScrollableWidget.prototype.scrollIntoView = function(element) {
|
||||
var duration = $tw.utils.getAnimationDuration();
|
||||
this.cancelScroll();
|
||||
this.startTime = Date.now();
|
||||
this.startTime = Date.now(),
|
||||
srcWindow = element ? element.ownerDocument.defaultView : window;
|
||||
var scrollPosition = {
|
||||
x: this.outerDomNode.scrollLeft,
|
||||
y: this.outerDomNode.scrollTop
|
||||
@ -122,7 +123,7 @@ ScrollableWidget.prototype.scrollIntoView = function(element) {
|
||||
self.outerDomNode.scrollLeft = scrollPosition.x + (endX - scrollPosition.x) * t;
|
||||
self.outerDomNode.scrollTop = scrollPosition.y + (endY - scrollPosition.y) * t;
|
||||
if(t < 1) {
|
||||
self.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);
|
||||
self.idRequestFrame = self.requestAnimationFrame.call(srcWindow,drawFrame);
|
||||
}
|
||||
};
|
||||
drawFrame();
|
||||
|
Loading…
Reference in New Issue
Block a user