mirror of https://github.com/lxndrblz/anatole.git

Kris - The Coding Unicorn
30.08.2022 ec5066bdb57e8927150cb9e1b37ad0cedb047716
fix: apply active class to submenu items (#350)

Co-authored-by: Alexander Bilz <mail@alexbilz.com>
1 files modified
20 ■■■■■ changed files
layouts/partials/navbar.html 20 ●●●●● patch | view | raw | blame | history
layouts/partials/navbar.html
@@ -22,21 +22,23 @@
          <li class="nav__list-item">
            <div class="optionswitch">
              <input class="optionswitch__picker" type="checkbox" id="menuoptionpicker" hidden />
              <label
                {{ range .Children }}
                  {{ if in $current.RelPermalink .URL }}
                    class="optionswitch__label nav__link--active"
                  {{ else }}
                    class="optionswitch__label"
                  {{ end }}
              {{ $labelClass := "optionswitch__label" }}
              {{ range .Children }}
                {{ if eq $url .URL }}
                  {{ $labelClass = "optionswitch__label nav__link--active" }}
                {{ end }}
                for="menuoptionpicker"
              {{ end }}
              <label class="{{ $labelClass }}" for="menuoptionpicker"
                >{{ .Name }} <i class="fa fa-angle-down" aria-hidden="true"></i
              ></label>
              <div class="optionswitch__triangle"></div>
              <ul class="optionswitch__list">
                {{ range .Children }}