Fix waypoint speed issue

This commit is contained in:
Sashko Stubailo
2014-10-27 11:42:38 -07:00
parent 4fa507539f
commit 7a4fa50b03
3 changed files with 14 additions and 11 deletions

View File

@@ -442,7 +442,7 @@ pre {
}
.logo {
width: 90%;
width: 180px;
margin-bottom: 10px;
}
}

View File

@@ -33,7 +33,7 @@
<h1>
<a href="{{topLink}}">
<img src="/logo.png" class="logo" alt="Meteor" />
1.0 Documentation
<div>1.0 Documentation</div>
</a>
</h1>

View File

@@ -28,16 +28,19 @@ Meteor.startup(function () {
var docsType = Session.get("fullApi") ? "full" : "basic";
Tracker.afterFlush(function () {
$.waypoints('destroy');
$('.main-content [id]').each(function (i, el) {
if (! $("#nav [href='#/" + docsType + '/' + el.id + "']").get(0)) {
// only add waypoints to things that have sidebar links
return;
}
$(el).waypoint(function() {
updateUrlFromWaypoint(this);
}, { context: $('.main-content') });
});
setTimeout(function () {
$('.main-content [id]').each(function (i, el) {
if (! $("#nav [href='#/" + docsType + '/' + el.id + "']").get(0)) {
// only add waypoints to things that have sidebar links
return;
}
$(el).waypoint(function() {
updateUrlFromWaypoint(this);
}, { context: $('.main-content') });
});
}, 0);
});
});
});