Website Summary Files Commits Branches @commit @diff @stats
path: root / wp-content / themes / carmag / assets / src / scripts / scripts.js
diff options
context:
space:
mode:
Commitf94290b51d573de0eeca469062f9606f0c11478e (patch)
Author
 Ivan Dimitrov <ivan.dimitrov293@gmail.com>
2020-07-03 11:36:42 +0300
Committer
 GitHub <noreply@github.com>
2020-07-03 11:36:42 +0300
Files27242d875986f99a816f793a133712da6dafc2f2 /wp-content/themes/carmag/assets/src/scripts/scripts.js
tues-interns-2020-f94290b51d573de0eeca469062f9606f0c11478e.tar
tues-interns-2020-f94290b51d573de0eeca469062f9606f0c11478e.tar.gz
tues-interns-2020-f94290b51d573de0eeca469062f9606f0c11478e.zip
Parent31837d2a233f3a2f838adac3af8687df10d69a69 (diff)
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.js25
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);
+}