Skip to content

Commit 1b23264

Browse files
committed
Fixing A NAME url bug
Using an A NAME tag to reference a link on the same page was causing the sidebar menu options to collapse on refresh. This change takes the provided docUrl variable in the documentation.js javascript and strips all characters after the "#" sign.
1 parent 1ed02a8 commit 1b23264

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

static/shared/js/documentation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ $(function() {
1111
if(docUrl){
1212
$('#js-sidebar .js-topic a').each(function(){
1313
var url = $(this).attr('href').toString()
14-
if(url.indexOf(docUrl[1]) >= 0 && url.length == docUrl[1].length){
14+
var cleanDocUrl = docUrl[1].split('#')[0]
15+
if(url.indexOf(cleanDocUrl) >= 0 && url.length == cleanDocUrl.length){
1516
$(this).parent('li').addClass('disable')
1617
var parentTopic = $(this).parentsUntil('div.sidebar-module > ul').last()
1718
parentTopic.addClass('js-current')

0 commit comments

Comments
 (0)