Files
grzanieplus.pl/web/js/bootstrap-hover-dropdown.min.js
2025-03-12 17:06:23 +01:00

1 line
979 B
JavaScript

(function(b,a,c){var d=b();b.fn.dropdownHover=function(e){if("ontouchstart" in document){return this}d=d.add(this.parent());return this.each(function(){var m=b(this),l=m.parent(),k={instantlyCloseOthers:true},i={instantlyCloseOthers:b(this).data("close-others")},g="show.bs.dropdown",j="hide.bs.dropdown",h=b.extend(true,{},k,e,i);l.hover(function(n){if(!l.hasClass("open")&&!m.is(n.target)){return true}f(n)},function(){l.removeClass("open");m.trigger(j)});m.hover(function(n){if(!l.hasClass("open")&&!l.is(n.target)){return true}f(n)});l.find(".dropdown-submenu").each(function(){var n=b(this);n.hover(function(){n.children(".dropdown-menu").show();n.siblings().children(".dropdown-menu").hide()},function(){var o=n.children(".dropdown-menu");o.hide()})});function f(n){d.find(":focus").blur();if(h.instantlyCloseOthers===true){d.removeClass("open")}l.addClass("open");m.trigger(g)}})};b(document).ready(function(){b('[data-hover="dropdown"]').dropdownHover()})})(jQuery,this);