sandalstrap.min.js 2.6 KB

1
  1. if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(t){"use strict";function e(e){var r=e.attr("data-target");r||(r=e.attr("href"),r=r&&/#[A-Za-z]/.test(r)&&r.replace(/.*(?=#[^\s]*$)/,""));var n=r&&t(r);return n&&n.length?n:e.parent()}function r(r){r&&3===r.which||r&&r.target.parentNode.className.indexOf&&r.target.parentNode.className.indexOf("disabled")>-1||(t(o).remove(),t(a).each(function(){var n=t(this),o=e(n),a={relatedTarget:this};o.hasClass("open")&&(r&&"click"==r.type&&/input|textarea/i.test(r.target.tagName)&&t.contains(o[0],r.target)||(o.trigger(r=t.Event("hide.bs.dropdown",a)),r.isDefaultPrevented()||(n.attr("aria-expanded","false"),o.removeClass("open").trigger(t.Event("hidden.bs.dropdown",a)))))}))}function n(e){return this.each(function(){var r=t(this),n=r.data("bs.dropdown");n||r.data("bs.dropdown",n=new i(this)),"string"==typeof e&&n[e].call(r)})}var o=".dropdown-backdrop",a='[data-toggle="dropdown"]',i=function(e){t(e).on("click.bs.dropdown",this.toggle)};i.VERSION="3.3.7",i.prototype.toggle=function(n){var o=t(this);if(!o.is(".disabled, :disabled")){var a=e(o),i=a.hasClass("open");if(r(),!i){"ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",r);var d={relatedTarget:this};if(a.trigger(n=t.Event("show.bs.dropdown",d)),n.isDefaultPrevented())return;o.trigger("focus").attr("aria-expanded","true"),a.toggleClass("open").trigger(t.Event("shown.bs.dropdown",d))}return!1}},i.prototype.keydown=function(r){if(/(38|40|27|32)/.test(r.which)&&!/input|textarea/i.test(r.target.tagName)){var n=t(this);if(r.preventDefault(),r.stopPropagation(),!n.is(".disabled, :disabled")){var o=e(n),i=o.hasClass("open");if(!i&&27!=r.which||i&&27==r.which)return 27==r.which&&o.find(a).trigger("focus"),n.trigger("click");var d=" li:not(.disabled):visible a",s=o.find(".dropdown-menu"+d);if(s.length){var c=s.index(r.target);38==r.which&&c>0&&c--,40==r.which&&c<s.length-1&&c++,~c||(c=0),s.eq(c).trigger("focus")}}}};var d=t.fn.dropdown;t.fn.dropdown=n,t.fn.dropdown.Constructor=i,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=d,this},t(document).on("click",r).on("click",".dropdown form",function(t){t.stopPropagation()}).on("click",a,i.prototype.toggle).on("keydown",a,i.prototype.keydown).on("keydown",".dropdown-menu",i.prototype.keydown)}(jQuery);