From cd05907c0428c11057a60800352684f26efbb5cf Mon Sep 17 00:00:00 2001 From: Lukas Juhas Date: Tue, 6 Jun 2017 15:46:03 +0100 Subject: [PATCH] correct typo, add script for toggle menu, remove forgotten console log --- README.md | 2 +- assets/scripts/scripts.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b71eb6..6c36b5c 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ This will execute all the Gulp tasks on the gulpfile.babel.js. ### Images -Drop all your images into assets/imagess. When running gulp tasks, they will be automatically +Drop all your images into assets/images. When running gulp tasks, they will be automatically optimised and output files will available in img folder in the root of the theme. ## WordPress Support diff --git a/assets/scripts/scripts.js b/assets/scripts/scripts.js index 65fd7fb..b0d32c8 100644 --- a/assets/scripts/scripts.js +++ b/assets/scripts/scripts.js @@ -1,3 +1,13 @@ import $ from 'jquery'; -console.log($); +/** + * Mobile navigation toggle + * @param {mixed} event + */ +const toggleMenu = (event) => { + event.preventDefault(); + $('.js-menu-toggle, .nav--header').toggleClass('open'); + $('.header').toggleClass('menu-open'); +}; +$('.js-menu-toggle').on('click', toggleMenu); +