mirror of
https://github.com/thangisme/notes.git
synced 2024-10-31 16:47:33 -04:00
Show / hide search with mobile nav
This commit is contained in:
parent
2d1305045e
commit
d3e231648f
@ -13,6 +13,7 @@ function toggleNav(){
|
|||||||
const nav = document.querySelector('.js-main-nav');
|
const nav = document.querySelector('.js-main-nav');
|
||||||
const auxNav = document.querySelector('.js-aux-nav');
|
const auxNav = document.querySelector('.js-aux-nav');
|
||||||
const navTrigger = document.querySelector('.js-main-nav-trigger');
|
const navTrigger = document.querySelector('.js-main-nav-trigger');
|
||||||
|
const search = document.querySelector('.js-search');
|
||||||
|
|
||||||
addEvent(navTrigger, 'click', function(){
|
addEvent(navTrigger, 'click', function(){
|
||||||
var text = navTrigger.innerText;
|
var text = navTrigger.innerText;
|
||||||
@ -21,6 +22,7 @@ function toggleNav(){
|
|||||||
nav.classList.toggle('nav-open');
|
nav.classList.toggle('nav-open');
|
||||||
auxNav.classList.toggle('nav-open');
|
auxNav.classList.toggle('nav-open');
|
||||||
navTrigger.classList.toggle('nav-open');
|
navTrigger.classList.toggle('nav-open');
|
||||||
|
search.classList.toggle('nav-open');
|
||||||
navTrigger.innerText = textToggle;
|
navTrigger.innerText = textToggle;
|
||||||
navTrigger.setAttribute('data-text-toggle', text);
|
navTrigger.setAttribute('data-text-toggle', text);
|
||||||
textToggle = text;
|
textToggle = text;
|
||||||
|
Loading…
Reference in New Issue
Block a user