mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Adjust docs to waypoints 2.x and add a delay for deps flush to increase performance on scroll.
This commit is contained in:
@@ -47,10 +47,17 @@ Meteor.startup(function () {
|
||||
}
|
||||
|
||||
var ignore_waypoints = false;
|
||||
$('body').delegate('h1, h2, h3', 'waypoint.reached', function (evt, dir) {
|
||||
var lastTimeout = null;
|
||||
$('h1, h2, h3').waypoint(function (evt, dir) {
|
||||
if (!ignore_waypoints) {
|
||||
var active = (dir === "up") ? this.prev : this;
|
||||
Session.set("section", active.id);
|
||||
if (active.id) {
|
||||
if (lastTimeout)
|
||||
Meteor.clearTimeout(lastTimeout);
|
||||
lastTimeout = Meteor.setTimeout(function () {
|
||||
Session.set("section", active.id);
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user