Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab panes: adaptation to Bootstrap 5 #1371

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions layouts/shortcodes/tabpane.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
{{end -}}
{{ end -}}

{{/* Nav tabs */ -}}
<ul class="nav nav-tabs{{ if $rightPane }} justify-content-end{{ end }}" id="tabs-{{- $Ordinal -}}" role="tablist">
{{ range $index, $element := $.Scratch.Get "tabs" -}}

Expand Down Expand Up @@ -84,12 +85,12 @@
{{ $tabid := printf "tabs-%02v-%v-tab" $Ordinal $index | anchorize -}}
{{ $entryid := printf "tabs-%02v-%v" $Ordinal $index | anchorize -}}

<a class="nav-link{{ if and ( not $activeSet ) ( not $disabled ) }} active{{ end }}{{ if $disabled }} disabled{{ end }}{{ if ne $lang "" }}{{ if and $persistLang (not $duplicate) }} persistLang-{{- $lang -}}{{ end }}{{ end }}"
id="{{ $tabid }}" data-toggle="tab" href="#{{ $entryid }}" role="tab"
<button class="nav-link{{ if and ( not $activeSet ) ( not $disabled ) }} active{{ end }}{{ if $disabled }} disabled{{ end }}{{ if ne $lang "" }}{{ if and $persistLang (not $duplicate) }} persistLang-{{- $lang -}}{{ end }}{{ end }}"
id="{{ $tabid }}" data-bs-toggle="tab" data-bs-target="#{{ $entryid }}" role="tab"
{{ if ne $lang "" }}{{ if and $persistLang (not $duplicate) }}onclick="persistLang({{ $lang }});"{{ end }}{{ end -}}
aria-controls="{{- $entryid -}}" aria-selected="{{- cond ( and ( not $activeSet ) ( not $disabled ) ) "true" "false" -}}">
{{ index . "header" | markdownify }}
</a>
</button>
</li>

{{- if not $disabled -}}
Expand All @@ -106,7 +107,7 @@
{{ $langs = slice -}}
{{ $activeSet = false -}}

{{/* Inner content */ -}}
{{/* Tab panes */ -}}
<div class="tab-content" id="tabs-{{ $Ordinal }}-content">
{{- range $index, $element := $.Scratch.Get "tabs" -}}

Expand Down Expand Up @@ -136,7 +137,7 @@
{{ $tabid := printf "tabs-%02v-%v-tab" $Ordinal $index | anchorize -}}
{{ $entryid := printf "tabs-%02v-%v" $Ordinal $index | anchorize }}
<div class="{{ if $text }}tab-body {{end}}tab-pane fade{{ if and ( not $activeSet ) ( not $disabled ) }} show active{{ end }}"
id="{{ $entryid }}" role="tabpanel" aria-labelled-by="{{ $tabid }}">
id="{{ $entryid }}" role="tabpanel" aria-labelled-by="{{ $tabid }}" tabindex="{{ $Ordinal }}">
{{ if $text -}}
{{ index . "content" -}}
{{ else -}}
Expand Down