diff options
Feature/header (#52)
* [Update] Styled the header and made it responsive. Changed primary colors.
* [Update] Cleaned _header.scss
* [Update] all buttons styles
* [Update] Merged feature/button-styles, fixed responsive design and fixed #34 #36 #37 #39
* header: remove the duplicated master.css load. We have a function in functions.php which handles the load of the assets files
* [Fix] Fixed header logo, register and login buttons classnames handled by wordpress
* [Fix] Fixed long word link content breaking down and fixed separator disappearing
Co-authored-by: Valentin <valentinspasov9669@gmail.com>
Co-authored-by: metodiew <stanko@metodiew.com>
1 files changed, 20 insertions, 5 deletions
| -rw-r--r-- | wp-content/themes/carmag/assets/src/scripts/scripts.js | 25 |
diff --git a/wp-content/themes/carmag/assets/src/scripts/scripts.js b/wp-content/themes/carmag/assets/src/scripts/scripts.js index b06e717..7b0f084 100644 --- a/wp-content/themes/carmag/assets/src/scripts/scripts.js +++ b/wp-content/themes/carmag/assets/src/scripts/scripts.js @@ -1,5 +1,5 @@ -jQuery( document ).ready( function ( $ ) { - 'use strict'; +jQuery(document).ready(function ($) { + "use strict"; /* |-------------------------------------------------------------------------- | Developer mode @@ -10,12 +10,27 @@ jQuery( document ).ready( function ( $ ) { | Id needed for development testing this variable should be used. | */ - const devMode = function() { + const devMode = function () { return true; }; // Disable console.log for production site. - if ( ! devMode() ) { - console.log = function() {}; + if (!devMode()) { + console.log = function () {}; } }); + +const toggleDrawer = () => { + const drawerClassList = event.target.classList; + const navClassList = document.querySelectorAll(".menu-primary-container")[0] + .classList; + drawerClassList.toggle("opened"); + navClassList.toggle("opened"); +}; + +const separator = document.createElement("span"); +separator.className = "separator"; +const loginLink = document.querySelectorAll(".login")[0]; +if (loginLink) { + loginLink.before(separator); +} |
