demarches-normaliennes/app/assets/javascripts/new_design/buttons.js

12 lines
305 B
JavaScript
Raw Normal View History

2017-08-02 16:20:01 +02:00
$(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");
}
});