You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
939 B
41 lines
939 B
2 years ago
|
/**
|
||
|
* @file
|
||
|
* Global utilities.
|
||
|
*
|
||
|
*/
|
||
|
(function ($, Drupal) {
|
||
|
|
||
|
'use strict';
|
||
|
|
||
|
Drupal.behaviors.bootstrap_barrio = {
|
||
|
attach: function (context, settings) {
|
||
|
|
||
|
var position = $(window).scrollTop();
|
||
|
$(window).scroll(function () {
|
||
|
if ($(this).scrollTop() > 50) {
|
||
|
$('body').addClass("scrolled");
|
||
|
}
|
||
|
else {
|
||
|
$('body').removeClass("scrolled");
|
||
|
}
|
||
|
var scroll = $(window).scrollTop();
|
||
|
if (scroll > position) {
|
||
|
$('body').addClass("scrolldown");
|
||
|
$('body').removeClass("scrollup");
|
||
|
} else {
|
||
|
$('body').addClass("scrollup");
|
||
|
$('body').removeClass("scrolldown");
|
||
|
}
|
||
|
position = scroll;
|
||
|
});
|
||
|
|
||
|
$('.dropdown-item a.dropdown-toggle').on("click", function (e) {
|
||
|
$(this).next('ul').toggle();
|
||
|
e.stopPropagation();
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
})(jQuery, Drupal);
|