mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fix scrolling to the top on docs type switch
This commit is contained in:
committed by
Sashko Stubailo
parent
a7a18ea1b5
commit
41fa4e651b
@@ -16,7 +16,7 @@
|
||||
{{> topBar}}
|
||||
<div class="main-content">
|
||||
<div id="main">
|
||||
<div id="top"></div>
|
||||
<div><div id="top"></div></div>
|
||||
<div class="{{layoutHidden 'full'}}">
|
||||
{{> fullApiContent}}
|
||||
</div>
|
||||
|
||||
@@ -29,6 +29,8 @@ Meteor.startup(function () {
|
||||
Tracker.afterFlush(function () {
|
||||
$.waypoints('destroy');
|
||||
|
||||
// XXX this timeout is a temporary hack to yield more before setting the
|
||||
// waypoints.
|
||||
setTimeout(function () {
|
||||
$('.main-content :not(.hidden) [id]').each(function (i, el) {
|
||||
if (! $("#nav [href='#/" + docsType + '/' + el.id + "']").get(0)) {
|
||||
@@ -89,7 +91,7 @@ Tracker.autorun(function () {
|
||||
|
||||
if (! id) {
|
||||
// will scroll to the very top
|
||||
id = "main";
|
||||
id = "top";
|
||||
}
|
||||
|
||||
// XXX this selector is tied to the structure of the document so tightly
|
||||
|
||||
Reference in New Issue
Block a user