mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-17 15:21:22 +00:00
Move the slowInSlowOut easing function into utils
This commit is contained in:
@@ -12,10 +12,6 @@ Module that creates a $tw.utils.Scroller object prototype that manages scrolling
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
var slowInSlowOut = function(t) {
|
||||
return (1 - ((Math.cos(t * Math.PI) + 1) / 2));
|
||||
};
|
||||
|
||||
/*
|
||||
Creates a Scroller object
|
||||
*/
|
||||
@@ -67,7 +63,7 @@ Scroller.prototype.scrollIntoView = function(domNode) {
|
||||
self.cancel();
|
||||
t = 1;
|
||||
}
|
||||
t = slowInSlowOut(t);
|
||||
t = $tw.utils.slowInSlowOut(t);
|
||||
window.scrollTo(self.startX + (self.endX - self.startX) * t,self.startY + (self.endY - self.startY) * t);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user