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

Kris - The Coding Unicorn
13.46.2022 1959fa6d400511da65044c29f1bc7c7030a31ca6
fix: incorrect display of submenu items when multiple menu dropdowns are implemented (#354)

Close #352

Co-authored-by: Alexander Bilz <mail@alexbilz.com>
1 files modified
25 ■■■■■ changed files
layouts/partials/navbar.html 25 ●●●●● patch | view | raw | blame | history
layouts/partials/navbar.html
@@ -15,33 +15,30 @@
  <nav class="nav">
    <ul class="nav__list" id="navMenu">
      {{ $url := .RelPermalink }}
      {{ $current := . }}
      {{ range .Site.Menus.main }}
        {{ $active := eq $url .URL }}
        {{ if .HasChildren }}
      {{ range $menuId, $menuItem := .Site.Menus.main }}
        {{ $active := eq $url $menuItem.URL }}
        {{ if $menuItem.HasChildren }}
          <li class="nav__list-item">
            <div class="optionswitch">
              <input class="optionswitch__picker" type="checkbox" id="menuoptionpicker" hidden />
              <input class="optionswitch__picker" type="checkbox" id="{{ $menuId }}" hidden />
              {{ $labelClass := "optionswitch__label" }}
              {{ range .Children }}
              {{ range $menuItem.Children }}
                {{ if eq $url .URL }}
                  {{ $labelClass = "optionswitch__label nav__link--active" }}
                {{ end }}
                {{ end }}
              {{ end }}
              <label class="{{ $labelClass }}" for="menuoptionpicker"
                >{{ .Name }} <i class="fa fa-angle-down" aria-hidden="true"></i
              <label class="{{ $labelClass }}" for="{{ $menuId }}"
                >{{ $menuItem.Name }} <i class="fa fa-angle-down" aria-hidden="true"></i
              ></label>
              <div class="optionswitch__triangle"></div>
              <ul class="optionswitch__list">
                {{ range .Children }}
                {{ range $menuItem.Children }}
                  <li class="optionswitch__list-item">
                    <a
                      href="{{ .URL }}"
@@ -72,7 +69,7 @@
              {{ end }}
              title="{{ .Title }}"
              >{{ .Name }}</a
              >{{ $menuItem.Name }}</a
            >
          </li>