Skip to content

Commit

Permalink
Merge pull request #26932 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Jul 20, 2023
2 parents 0c4e3a4 + e866ceb commit 07f9910
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/article/ToolPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ function showToolSpecificContent(tool: string, supportedTools: Array<string>) {
.filter((el) => supportedTools.some((tool) => el.classList.contains(tool)))
.forEach((el) => {
el.style.display = el.classList.contains(tool) ? '' : 'none'

// hack: special handling for minitoc links -- we can't pass the tool classes
// directly to the Primer NavList.Item generated <li>, it gets passed down
// to the child <a>. So if we find an <a> that has the tool class and its
// parent is an <li>, we hide/unhide that element as well.
if (el.tagName === 'A' && el.parentElement && el.parentElement.tagName === 'LI') {
el.parentElement.style.display = el.classList.contains(tool) ? '' : 'none'
}
})

// find all tool-specific *inline* elements and hide or show as appropriate
Expand Down

0 comments on commit 07f9910

Please sign in to comment.