META-INF.resources.bsf.js.dropdown.js Maven / Gradle / Ivy
/*
========================================================================
Bootstrap: dropdown.js v3.3.7
http://getbootstrap.com/javascript/#dropdowns
========================================================================
Copyright 2011-2016 Twitter, Inc.
Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
======================================================================== */
+function(d){function f(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(b))&&b.length?b:a.parent()}function g(a){a&&3===a.which||(d(".dropdown-backdrop").remove(),d('[data-toggle="dropdown"]').each(function(){var b=d(this),c=f(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 e=function(a){d(a).on("click.bs.dropdown",this.toggle)};e.VERSION="3.3.7";e.prototype.toggle=function(a){var b=d(this);if(!b.is(".disabled, :disabled")){var c=f(b);a=c.hasClass("open");g();if(!a){if("ontouchstart"in document.documentElement&&!c.closest(".navbar-nav").length)d(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(d(this)).on("click",g);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}};e.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=f(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