1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-04-24 15:51:30 +00:00

Improved rounder close icon

This commit is contained in:
Jeremy Ruston
2012-07-20 22:09:34 +01:00
parent cc0ec50b1d
commit cc59a49b39
8 changed files with 37 additions and 28 deletions

View File

@@ -33,13 +33,14 @@ Scroller.prototype.cancel = function() {
Smoothly scroll an element back into view if needed
*/
Scroller.prototype.scrollIntoView = function(element) {
var scrollPosition = $tw.utils.getScrollPosition();
var scrollPosition = $tw.utils.getScrollPosition(),
elementBounds = element.getBoundingClientRect();
this.cancel();
this.startTime = new Date();
this.startX = scrollPosition.x;
this.startY = scrollPosition.y;
this.endX = element.offsetLeft;
this.endY = element.offsetTop;
this.endX = elementBounds.left;
this.endY = elementBounds.top;
if((this.endX < this.startX) || (this.endX > (this.startX + window.innerWidth)) || (this.endY < this.startY) || (this.endY > (this.startY + window.innerHeight))) {
var self = this;
this.timerId = window.setInterval(function() {