Skip to content

Commit 81536ca

Browse files
patmellonbrsoff
authored andcommitted
[PYT-117] Prevent page from jumping when main content nav links are clicked (#31)
1 parent 0ea35b2 commit 81536ca

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

get-started/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ <h1>Get<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Started</h1>
4545

4646
{% for item in items %}
4747
<div class="article-wrapper" data-slug="{{ item.slug }}">
48-
<a name="{{ item.slug }}"></a>
49-
5048
<article>
5149
{{ item.content }}
5250
</article>
@@ -99,13 +97,13 @@ <h5>Course Name</h5>
9997
<script type="text/javascript">
10098
// This page includes content that is hidden from view until clicked in the article menu.
10199
// This ensures that named links display the correct content on page load
102-
var pageHash = window.location.hash.replace(/^#/, '');
103100

101+
var pageHash = window.location.hash.replace(/^#/, '');
104102
if (pageHash) {
105103
showArticle(pageHash);
106104
} else {
107-
var firstArticleSlug = $('.article-wrapper:first').data('slug');
108-
showArticle(firstArticleSlug);
105+
showArticle("start-locally");
106+
$('.nav-link[data-id="start-locally"]').parent(".nav-item").addClass("nav-select");
109107
}
110108

111109
$('.nav-link[data-id="' + pageHash + '"]').parent(".nav-item").addClass("nav-select");

0 commit comments

Comments
 (0)