hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 275ff1a2a4441b0d7b240bdb3d0d3995491b9de7
parent 9a2c3bdb7284dc5940689fe7dbc4c8789c7084f8
Author: Hugo Soucy <hugo.soucy@savoirfairelinux.com>
Date:   Wed, 28 Jun 2017 15:41:44 -0400

Start to modify the script of the navigation

Diffstat:
Mstatic/dev/js/custom/init.js | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/static/dev/js/custom/init.js b/static/dev/js/custom/init.js @@ -5,9 +5,12 @@ function setNavigation() { var $nav_panel; var $nav_close; + console.log(document.querySelector('#navButtonTpl')); + if ($nav) { $nav_button = document.querySelector('.nav-button'); $nav_panel = $nav.querySelector('.nav__panel'); + $nav_close = $nav_panel.querySelector('.nav__close'); du.setClass($nav_panel, 'state--hidden'); @@ -34,7 +37,7 @@ function setHashtagSearch() { hashTags.forEach(function(tag) { du.setEvent(tag, 'click', function(thatEvt) { thatEvt.preventDefault(); - + console.log(tag.innerHTML); document.forms['search'].elements['q'].value = tag.innerHTML; @@ -57,5 +60,13 @@ function setClickableHashtags(fn) { fn(); } +// document.body.insertAdjacentHTML( +// 'afterbegin', document.querySelector('#navButtonTpl').innerHTML +// ); + +// document.body.insertAdjacentHTML( +// 'beforeend', document.querySelector('#navCloseTpl').innerHTML +// ); + setNavigation(); // setClickableHashtags(setHashtagSearch);