META-INF.resources.bsf.js.modal.js Maven / Gradle / Ivy
The newest version!
/*
========================================================================
Bootstrap: modal.js v3.4.1
https://getbootstrap.com/docs/3.4/javascript/#modals
========================================================================
Copyright 2011-2019 Twitter, Inc.
Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
======================================================================== */
var process=process||{env:{NODE_ENV:"development"}};
+function(b){function h(a,c){return this.each(function(){var e=b(this),f=e.data("bs.modal"),g=b.extend({},d.DEFAULTS,e.data(),"object"==typeof a&&a);f||e.data("bs.modal",f=new d(this,g));if("string"==typeof a)f[a](c);else g.show&&f.show(c)})}var d=function(a,c){this.options=c;this.$body=b(document.body);this.$element=b(a);this.$dialog=this.$element.find(".modal-dialog");this.originalBodyPad=this.isShown=this.$backdrop=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom";
this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,b.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};d.VERSION="3.4.1";d.TRANSITION_DURATION=300;d.BACKDROP_TRANSITION_DURATION=150;d.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};d.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)};d.prototype.show=function(a){var c=this,e=b.Event("show.bs.modal",{relatedTarget:a});this.$element.trigger(e);this.isShown||e.isDefaultPrevented()||
(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',b.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){c.$element.one("mouseup.dismiss.bs.modal",function(f){b(f.target).is(c.$element)&&(c.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=b.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body);
c.$element.show().scrollTop(0);c.adjustDialog();f&&c.$element[0].offsetWidth;c.$element.addClass("in");c.enforceFocus();var g=b.Event("shown.bs.modal",{relatedTarget:a});f?c.$dialog.one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(g)}).emulateTransitionEnd(d.TRANSITION_DURATION):c.$element.trigger("focus").trigger(g)}))};d.prototype.hide=function(a){a&&a.preventDefault();a=b.Event("hide.bs.modal");this.$element.trigger(a);this.isShown&&!a.isDefaultPrevented()&&(this.isShown=!1,
this.escape(),this.resize(),b(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),b.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",b.proxy(this.hideModal,this)).emulateTransitionEnd(d.TRANSITION_DURATION):this.hideModal())};d.prototype.enforceFocus=function(){b(document).off("focusin.bs.modal").on("focusin.bs.modal",b.proxy(function(a){document===
a.target||this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))};d.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keydown.dismiss.bs.modal",b.proxy(function(a){27==a.which&&this.hide()},this));else this.isShown||this.$element.off("keydown.dismiss.bs.modal")};d.prototype.resize=function(){if(this.isShown)b(window).on("resize.bs.modal",b.proxy(this.handleUpdate,this));else b(window).off("resize.bs.modal")};d.prototype.hideModal=
function(){var a=this;this.$element.hide();this.backdrop(function(){a.$body.removeClass("modal-open");a.resetAdjustments();a.resetScrollbar();a.$element.trigger("hidden.bs.modal")})};d.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};d.prototype.backdrop=function(a){var c=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=b.support.transition&&e;this.$backdrop=b(document.createElement("div")).addClass("modal-backdrop "+
e).appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",b.proxy(function(g){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:g.target===g.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this));f&&this.$backdrop[0].offsetWidth;this.$backdrop.addClass("in");a&&(f?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(d.BACKDROP_TRANSITION_DURATION):a())}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e=function(){c.removeBackdrop();
a&&a()},b.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(d.BACKDROP_TRANSITION_DURATION):e()):a&&a()};d.prototype.handleUpdate=function(){this.adjustDialog()};d.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})};d.prototype.resetAdjustments=
function(){this.$element.css({paddingLeft:"",paddingRight:""})};d.prototype.checkScrollbar=function(){var a=window.innerWidth;a||(a=document.documentElement.getBoundingClientRect(),a=a.right-Math.abs(a.left));this.bodyIsOverflowing=document.body.clientWidth