mirror of
https://github.com/StarCitizenTools/mediawiki-extensions-TabberNeue.git
synced 2024-09-23 10:26:50 +00:00
feat: add background fade to indicate scrollable tab header
This commit is contained in:
parent
094f82ed48
commit
750dd273be
|
@ -128,13 +128,17 @@ function initTabber( tabber, count ) {
|
|||
|
||||
// Just to add the right classes
|
||||
updateButtons();
|
||||
prevButton.addEventListener( 'click', function() {
|
||||
scrollTabs( -scrollOffset );
|
||||
}, false );
|
||||
|
||||
nextButton.addEventListener( 'click', function() {
|
||||
scrollTabs( scrollOffset );
|
||||
}, false );
|
||||
// Button only shows on pointer devices
|
||||
if ( matchMedia( '(hover: hover)' ).matches ) {
|
||||
prevButton.addEventListener( 'click', function() {
|
||||
scrollTabs( -scrollOffset );
|
||||
}, false );
|
||||
|
||||
nextButton.addEventListener( 'click', function() {
|
||||
scrollTabs( scrollOffset );
|
||||
}, false );
|
||||
}
|
||||
} else {
|
||||
container.classList.remove( NEXTCLASS );
|
||||
container.classList.remove( PREVCLASS );
|
||||
|
@ -328,10 +332,7 @@ function initTabber( tabber, count ) {
|
|||
|
||||
switchTab();
|
||||
|
||||
// Only run if client is not a touch device
|
||||
if ( matchMedia( '(hover: hover)' ).matches ) {
|
||||
initButtons();
|
||||
}
|
||||
initButtons();
|
||||
|
||||
// window.addEventListener( 'hashchange', switchTab, false );
|
||||
|
||||
|
|
|
@ -196,6 +196,22 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media ( hover: none ) {
|
||||
// Need extra specificity to override
|
||||
.tabber {
|
||||
.tabber__header {
|
||||
&__prev,
|
||||
&__next {
|
||||
pointer-events: none; // Disable arrow button
|
||||
|
||||
&:after {
|
||||
background-image: none; // Remove arrow icon
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media ( hover: hover ) {
|
||||
.tabber {
|
||||
&__tab {
|
||||
|
|
Loading…
Reference in a new issue