mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
tabs: remove active tab from tab order #726
This commit is contained in:
parent
b5d8b1cc31
commit
1b0e888861
2 changed files with 3 additions and 3 deletions
|
@ -74,7 +74,7 @@
|
||||||
{{- range $idx, $tab := $tabs }}
|
{{- range $idx, $tab := $tabs }}
|
||||||
<button
|
<button
|
||||||
data-tab-item="{{ .itemid }}"
|
data-tab-item="{{ .itemid }}"
|
||||||
class="tab-nav-button tab-panel-style cstyle {{ .style }}{{ cond (eq $idx 0) " active" ""}}"{{ if .color }} style="--VARIABLE-BOX-color: {{ .color }};"{{ end }}
|
class="tab-nav-button tab-panel-style cstyle {{ .style }}{{ cond (eq $idx 0) " active" ""}}"{{ if .color }} style="--VARIABLE-BOX-color: {{ .color }};"{{ end }}{{ if eq $idx 0 }} tabindex="-1"{{ end }}
|
||||||
onclick="switchTab('{{ $groupid }}','{{ .itemid }}')"
|
onclick="switchTab('{{ $groupid }}','{{ .itemid }}')"
|
||||||
>
|
>
|
||||||
<span class="tab-nav-text">{{ if .icon }}<i class="{{ .icon }}"></i>{{ end }}{{ if and .icon .title }} {{ end }}{{ .title | $page.RenderString }}{{ if (not .title) }}​{{ end }}</span>
|
<span class="tab-nav-text">{{ if .icon }}<i class="{{ .icon }}"></i>{{ end }}{{ if and .icon .title }} {{ end }}{{ .title | $page.RenderString }}{{ if (not .title) }}​{{ end }}</span>
|
||||||
|
|
|
@ -115,8 +115,8 @@ function switchTab(tabGroup, tabId) {
|
||||||
var yposButton = event.target.getBoundingClientRect().top;
|
var yposButton = event.target.getBoundingClientRect().top;
|
||||||
}
|
}
|
||||||
|
|
||||||
allTabItems && allTabItems.forEach( function( e ){ e.classList.remove( 'active' ); });
|
allTabItems && allTabItems.forEach( function( e ){ e.classList.remove( 'active' ); e.removeAttribute( 'tabindex' ); });
|
||||||
targetTabItems && targetTabItems.forEach( function( e ){ e.classList.add( 'active' ); });
|
targetTabItems && targetTabItems.forEach( function( e ){ e.classList.add( 'active' ); e.setAttribute( 'tabindex', '-1' ); });
|
||||||
|
|
||||||
if(isButtonEvent){
|
if(isButtonEvent){
|
||||||
initMermaid( true );
|
initMermaid( true );
|
||||||
|
|
Loading…
Reference in a new issue