Skip to content

Commit

Permalink
Fix #1137 - stop Bootstrap section menus from breaking if text is sty…
Browse files Browse the repository at this point in the history
…led (e.g. bold)
  • Loading branch information
FayCross authored and torinfo committed Jul 15, 2022
1 parent 7610233 commit 32ec2d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/site/parent_templates/site/common/js/application.js
Expand Up @@ -1677,13 +1677,14 @@ function loadPage(page, pageHash, sectionNum, contentNum, pageIndex, standAloneP

//add a TOC entry
var tocName = $(this).attr('name');

// remove size & background color styles from links on toc
if ($('<p>' + tocName + '</p>').children().length > 0 && tocName.indexOf("sup") < 0) {
tocName = $(tocName);
if ($('<p>' + tocName + '</p>').children().length > 0) {
tocName = $('<p>'+tocName+'</p>');
tocName.css({ 'font-size': '', 'background-color': 'transparent' });
tocName.find('[style*="font-size"]').css('font-size', '');
tocName.find('[style*="background-color"]').css('background-color', 'transparent');
tocName = tocName.html();
}

var $link = $('<li' + (sectionVisibleIndex==0?' class="active"':'') +'><a href="#' + pageHash + 'section' + (sectionVisibleIndex+1) + '"></a></li>').appendTo('#toc');
Expand Down

0 comments on commit 32ec2d3

Please sign in to comment.