demarches-normaliennes/app/assets/javascripts/new_design/buttons.js
2017-09-06 11:13:59 +02:00

11 lines
305 B
JavaScript

$(document).on("click", "body", function () {
$(".button.dropdown").removeClass("open");
});
$(document).on("click", ".button.dropdown", function(event) {
event.stopPropagation();
var $target = $(event.target);
if($target.hasClass("button", "dropdown")){
$target.toggleClass("open");
}
});