2023-11-30 17:33:32 +01:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* erabletheme behaviors.
|
|
|
|
*/
|
|
|
|
(function (Drupal) {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
Drupal.behaviors.erabletheme = {
|
|
|
|
attach: function (context, settings) {
|
|
|
|
|
2023-12-06 17:06:45 +01:00
|
|
|
(function($, window) {
|
|
|
|
let slickEl = $('.slick-container').children().first().children().first().children().first().children().first();
|
|
|
|
$(slickEl).slick({
|
|
|
|
arrows: false,
|
|
|
|
dots: true,
|
|
|
|
appendDots: $('#carousel_dots')
|
|
|
|
});
|
|
|
|
})(jQuery, window);
|
|
|
|
|
2023-12-06 05:01:23 +01:00
|
|
|
const hamburgerBtn = document.getElementById("hamburger");
|
|
|
|
const menu = hamburgerBtn.nextElementSibling;
|
|
|
|
|
|
|
|
// Toggle menu visibility on hamburger click
|
|
|
|
hamburgerBtn.addEventListener("click", function(event) {
|
|
|
|
event.stopPropagation();
|
|
|
|
menu.classList.toggle("active");
|
|
|
|
});
|
|
|
|
|
|
|
|
// Close menu when clicking outside of the menu
|
|
|
|
document.addEventListener("click", function(event) {
|
|
|
|
const isMenuClicked = event.target.closest("#menu") !== null;
|
|
|
|
const isHamburgerClicked = event.target === hamburgerBtn;
|
|
|
|
|
|
|
|
if (!isMenuClicked && !isHamburgerClicked) {
|
|
|
|
menu.classList.remove("active");
|
|
|
|
}
|
|
|
|
});
|
2023-11-30 17:33:32 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} (Drupal));
|