Skip to content

Commit

Permalink
V2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
diederik committed Dec 18, 2020
1 parent 648026c commit 0ef2fd0
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
Binary file modified _demo/.DS_Store
Binary file not shown.
Binary file modified _demo/pages/.DS_Store
Binary file not shown.
Binary file modified _demo/pages/01.home/.DS_Store
Binary file not shown.
38 changes: 0 additions & 38 deletions js/dropdown.js

This file was deleted.

41 changes: 40 additions & 1 deletion js/gravtail.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,43 @@ document.addEventListener('scroll', function () {

}

});
});

/*Toggle dropdown list*/
/*https://gist.github.com/slavapas/593e8e50cf4cc16ac972afcbad4f70c8*/

var navMenuDiv = document.getElementById("nav-content");
var navMenu = document.getElementById("nav-toggle");

document.onclick = check;

function check(e) {
var target = (e && e.target) || (event && event.srcElement);

//Nav Menu
if (!checkParent(target, navMenuDiv)) {
// click NOT on the menu
if (checkParent(target, navMenu)) {
// click on the link
if (navMenuDiv.classList.contains("hidden")) {
navMenuDiv.classList.remove("hidden");
} else {
navMenuDiv.classList.add("hidden");
}
} else {
// click both outside link and outside menu, hide menu
navMenuDiv.classList.add("hidden");
}
}

}

function checkParent(t, elm) {
while (t.parentNode) {
if (t == elm) {
return true;
}
t = t.parentNode;
}
return false;
}
4 changes: 2 additions & 2 deletions templates/modular/hero.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<p class="leading-normal text-2xl mb-8">{{ page.header.sub_hero_title }}</p>


<a href=" {{ page.header.hreo_action_url }}" class="mx-auto lg:mx-0 hover:underline bg-white text-gray-800 font-bold rounded-full my-6 py-4 px-8 shadow-lg inline-block">
<a href=" {{ page.header.hero_action_url }}" class="mx-auto lg:mx-0 hover:underline bg-white text-gray-800 font-bold rounded-full my-6 py-4 px-8 shadow-lg inline-block">
{{ page.header.hero_action }}
</a>

Expand Down Expand Up @@ -39,4 +39,4 @@
</g>
</g>
</svg>
</div>
</div>

0 comments on commit 0ef2fd0

Please sign in to comment.