feat: use CSS instead of __NOEDITSECTION__ to hide edit buttons

* Appending __NOEDITSECTION__ to tab body seems to break the table markup (#12)
* Edit buttons still work for transcluded tabs so it should be visible

Closes #12
This commit is contained in:
alistair3149 2022-04-19 10:36:38 -04:00
parent 38a47307d7
commit 69c638330d
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C
2 changed files with 7 additions and 3 deletions

View file

@ -72,9 +72,7 @@ class TabberNeueHooks {
// Use array_pad to make sure at least 2 array values are always returned
list( $tabName, $tabBody ) = array_pad( array_map( 'trim', explode( '=', $tab, 2 ) ), 2, '' );
// Append __NOEDITSECTION__ to prevent section edit links from being added by the parser
// since section edit links do not work inside a tabber body
$tabBody = $parser->recursiveTagParseFully( '__NOEDITSECTION__' . $tabBody, $frame );
$tabBody = $parser->recursiveTagParseFully( $tabBody, $frame );
$tab = '<article class="tabber__panel" title="' . htmlspecialchars( $tabName ) .
'">' . $tabBody . '</article>';

View file

@ -138,6 +138,12 @@
overflow-y: auto;
overscroll-behavior-y: contain;
scroll-snap-align: start;
// Hide edit buttons for non-transclusion tabs since they don't work
/* stylelint-disable-next-line selector-class-pattern */
&:not( [ data-tabber-page-title ] ) .mw-editsection {
display: none;
}
}
&__transclusion {