Merge "[TOC] Remove pointer-events:none on .sidebar-toc-link"
This commit is contained in:
commit
a68409d262
|
@ -294,9 +294,13 @@ module.exports = function tableOfContents( props ) {
|
|||
/** @type {HTMLElement | null} */ ( e.target.closest( `.${SECTION_CLASS}` ) );
|
||||
|
||||
if ( tocSection && tocSection.id ) {
|
||||
if ( e.target.classList.contains( LINK_CLASS ) ) {
|
||||
// In case section link contains HTML,
|
||||
// test if click occurs on any child elements.
|
||||
if ( e.target.closest( `.${LINK_CLASS}` ) ) {
|
||||
props.onHeadingClick( tocSection.id );
|
||||
}
|
||||
// Toggle button does not contain child elements,
|
||||
// so classList check will suffice.
|
||||
if ( e.target.classList.contains( TOGGLE_CLASS ) ) {
|
||||
props.onToggleClick( tocSection.id );
|
||||
}
|
||||
|
|
|
@ -30,21 +30,12 @@
|
|||
border: 0;
|
||||
}
|
||||
|
||||
.sidebar-toc-link {
|
||||
word-break: break-word;
|
||||
|
||||
> * {
|
||||
// Prevent click events on the link's contents so that we can use event
|
||||
// delegation and have the target be the anchor element instead.
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar-toc-numb {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sidebar-toc-link {
|
||||
word-break: break-word;
|
||||
color: @color-link;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue