MediaWiki:SupportPage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
highlight current section when page first loads, as well as after scrolling |
check for currentSection being undefined (e.g. scrolling at top of page) |
||
Line 54: | Line 54: | ||
}); |
}); |
||
currentSection = currentSection[currentSection.length - 1]; |
currentSection = currentSection[currentSection.length - 1]; |
||
if ( lastSection !== currentSection ) { |
if ( currentSection && lastSection !== currentSection ) { |
||
lastSection = currentSection; |
lastSection = currentSection; |
||
$('#toc > ul a').removeClass('-active'); |
$('#toc > ul a').removeClass('-active'); |