Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit 7289b7f

Browse files
committed
Correctly show last opened item on page load.
1 parent aec4d63 commit 7289b7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_assets/js/swift-site.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ $(function() {
139139
$(link).html( $(link).html().replace(/^(init|subscript)/, '<span class="identifier">$1</span>') );
140140

141141
// expand the hashed item on page load
142-
var hash = link.href.substring(link.href.lastIndexOf('#')).replace('#comment-', '#');
143-
if (hash == location.hash) link.click();
142+
var hash = link.href.substring(link.href.lastIndexOf('#'));
143+
if (hash.replace('#comment-', '#') == location.hash) $(hash).addClass('in');
144144
});
145145

146146
// add toggle actions to all toggle links

0 commit comments

Comments
 (0)