META-INF.resources.bsf.js.dropdown.js Maven / Gradle / Ivy
The newest version!
/*
========================================================================
Bootstrap: dropdown.js v3.4.1
https://getbootstrap.com/docs/3.4/javascript/#dropdowns
========================================================================
Copyright 2011-2019 Twitter, Inc.
Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
======================================================================== */
var process=process||{env:{NODE_ENV:"development"}};
+function(d){function g(a){var b=a.attr("data-target");b||(b=(b=a.attr("href"))&&/#[A-Za-z]/.test(b)&&b.replace(/.*(?=#[^\s]*$)/,""));return(b="#"!==b?d(document).find(b):null)&&b.length?b:a.parent()}function h(a){a&&3===a.which||(d(".dropdown-backdrop").remove(),d('[data-toggle="dropdown"]').each(function(){var b=d(this),c=g(b),e={relatedTarget:this};!c.hasClass("open")||a&&"click"==a.type&&/input|textarea/i.test(a.target.tagName)&&d.contains(c[0],a.target)||(c.trigger(a=d.Event("hide.bs.dropdown",
e)),a.isDefaultPrevented()||(b.attr("aria-expanded","false"),c.removeClass("open").trigger(d.Event("hidden.bs.dropdown",e))))}))}var f=function(a){d(a).on("click.bs.dropdown",this.toggle)};f.VERSION="3.4.1";f.prototype.toggle=function(a){var b=d(this);if(!b.is(".disabled, :disabled")){var c=g(b);a=c.hasClass("open");h();if(!a){if("ontouchstart"in document.documentElement&&!c.closest(".navbar-nav").length)d(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(d(this)).on("click",
h);var e={relatedTarget:this};c.trigger(a=d.Event("show.bs.dropdown",e));if(a.isDefaultPrevented())return;b.trigger("focus").attr("aria-expanded","true");c.toggleClass("open").trigger(d.Event("shown.bs.dropdown",e))}return!1}};f.prototype.keydown=function(a){if(/(38|40|27|32)/.test(a.which)&&!/input|textarea/i.test(a.target.tagName)){var b=d(this);a.preventDefault();a.stopPropagation();if(!b.is(".disabled, :disabled")){var c=g(b),e=c.hasClass("open");if(!e&&27!=a.which||e&&27==a.which)return 27==
a.which&&c.find('[data-toggle="dropdown"]').trigger("focus"),b.trigger("click");b=c.find(".dropdown-menu li:not(.disabled):visible a");b.length&&(c=b.index(a.target),38==a.which&&0