mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-05-18 07:44:18 +00:00
deploy: 56bc99b79a
This commit is contained in:
parent
179be2508f
commit
c033020e80
359 changed files with 8370 additions and 8400 deletions
js
|
@ -59,17 +59,20 @@ function switchTab(tabGroup, tabId) {
|
|||
return !!e.querySelector( '[data-tab-item="'+tabId+'"]' );
|
||||
});
|
||||
var allTabItems = tabs && tabs.reduce( function( a, e ){
|
||||
return a.concat( Array.from( e.querySelectorAll( '.tab-nav-button, .tab-item' ) ) );
|
||||
return a.concat( Array.from( e.querySelectorAll( '[data-tab-item]' ) ).filter( function( es ){
|
||||
return es.parentNode.parentNode == e;
|
||||
}) );
|
||||
}, [] );
|
||||
var targetTabItems = tabs && tabs.reduce( function( a, e ){
|
||||
return a.concat( Array.from( e.querySelectorAll( '[data-tab-item="'+tabId+'"]' ) ) );
|
||||
return a.concat( Array.from( e.querySelectorAll( '[data-tab-item="'+tabId+'"]' ) ).filter( function( es ){
|
||||
return es.parentNode.parentNode == e;
|
||||
}) );
|
||||
}, [] );
|
||||
|
||||
// if event is undefined then switchTab was called from restoreTabSelection
|
||||
// so it's not a button event and we don't need to safe the selction or
|
||||
// prevent page jump
|
||||
var isButtonEvent = event && event.target && event.target.getBoundingClientRect;
|
||||
|
||||
if(isButtonEvent){
|
||||
// save button position relative to viewport
|
||||
var yposButton = event.target.getBoundingClientRect().top;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue