diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-11-08 11:11:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-08 11:11:23 +0300 |
commit | cc6f66f72a180af1910bb5f520f2067ad705f1b8 (patch) | |
tree | 52936e0cea75f13d2a98541825bfc90444235330 /dist/js/bootstrap.js | |
parent | eb849d73cda18a660d13c22b25a9e7ebbf42faca (diff) |
Dist (#29638)
Diffstat (limited to 'dist/js/bootstrap.js')
-rw-r--r-- | dist/js/bootstrap.js | 64 |
1 files changed, 42 insertions, 22 deletions
diff --git a/dist/js/bootstrap.js b/dist/js/bootstrap.js index becf4a9f9a..fbaa847f72 100644 --- a/dist/js/bootstrap.js +++ b/dist/js/bootstrap.js @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('popper.js')) : typeof define === 'function' && define.amd ? define(['popper.js'], factory) : (global = global || self, global.bootstrap = factory(global.Popper)); -}(this, function (Popper) { 'use strict'; +}(this, (function (Popper) { 'use strict'; Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; @@ -213,7 +213,9 @@ } if (element.style && element.parentNode && element.parentNode.style) { - return element.style.display !== 'none' && element.parentNode.style.display !== 'none' && element.style.visibility !== 'hidden'; + var elementStyle = getComputedStyle(element); + var parentNodeStyle = getComputedStyle(element.parentNode); + return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden'; } return false; @@ -1213,7 +1215,7 @@ function normalizeDataKey(key) { return key.replace(/[A-Z]/g, function (chr) { - return chr.toLowerCase(); + return "-" + chr.toLowerCase(); }); } @@ -1609,8 +1611,6 @@ event.preventDefault(); this.next(); break; - - default: } }; @@ -2727,7 +2727,7 @@ return; } - var items = makeArray(SelectorEngine.find(Selector$4.VISIBLE_ITEMS, parent)); + var items = makeArray(SelectorEngine.find(Selector$4.VISIBLE_ITEMS, parent)).filter(isVisible); if (!items.length) { return; @@ -2842,6 +2842,7 @@ }; var Event$6 = { HIDE: "hide" + EVENT_KEY$5, + HIDE_PREVENTED: "hidePrevented" + EVENT_KEY$5, HIDDEN: "hidden" + EVENT_KEY$5, SHOW: "show" + EVENT_KEY$5, SHOWN: "shown" + EVENT_KEY$5, @@ -2859,7 +2860,8 @@ BACKDROP: 'modal-backdrop', OPEN: 'modal-open', FADE: 'fade', - SHOW: 'show' + SHOW: 'show', + STATIC: 'modal-static' }; var Selector$5 = { DIALOG: '.modal-dialog', @@ -3099,9 +3101,7 @@ if (this._isShown && this._config.keyboard) { EventHandler.on(this._element, Event$6.KEYDOWN_DISMISS, function (event) { if (event.which === ESCAPE_KEYCODE$1) { - event.preventDefault(); - - _this5.hide(); + _this5._triggerBackdropTransition(); } }); } else { @@ -3173,11 +3173,7 @@ return; } - if (_this8._config.backdrop === 'static') { - _this8._element.focus(); - } else { - _this8.hide(); - } + _this8._triggerBackdropTransition(); }); if (animate) { @@ -3214,6 +3210,30 @@ } else { callback(); } + }; + + _proto._triggerBackdropTransition = function _triggerBackdropTransition() { + var _this9 = this; + + if (this._config.backdrop === 'static') { + var hideEvent = EventHandler.trigger(this._element, Event$6.HIDE_PREVENTED); + + if (hideEvent.defaultPrevented) { + return; + } + + this._element.classList.add(ClassName$5.STATIC); + + var modalTransitionDuration = getTransitionDurationFromElement(this._element); + EventHandler.one(this._element, TRANSITION_END, function () { + _this9._element.classList.remove(ClassName$5.STATIC); + }); + emulateTransitionEnd(this._element, modalTransitionDuration); + + this._element.focus(); + } else { + this.hide(); + } } // ---------------------------------------------------------------------- // the following methods are used to handle overflowing modals // ---------------------------------------------------------------------- @@ -3243,7 +3263,7 @@ }; _proto._setScrollbar = function _setScrollbar() { - var _this9 = this; + var _this10 = this; if (this._isBodyOverflowing) { // Note: DOMNode.style.paddingRight returns the actual value or '' if not set @@ -3253,14 +3273,14 @@ var actualPadding = element.style.paddingRight; var calculatedPadding = window.getComputedStyle(element)['padding-right']; Manipulator.setDataAttribute(element, 'padding-right', actualPadding); - element.style.paddingRight = parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"; + element.style.paddingRight = parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"; }); // Adjust sticky content margin makeArray(SelectorEngine.find(Selector$5.STICKY_CONTENT)).forEach(function (element) { var actualMargin = element.style.marginRight; var calculatedMargin = window.getComputedStyle(element)['margin-right']; Manipulator.setDataAttribute(element, 'margin-right', actualMargin); - element.style.marginRight = parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"; + element.style.marginRight = parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"; }); // Adjust body padding var actualPadding = document.body.style.paddingRight; @@ -3361,7 +3381,7 @@ EventHandler.on(document, Event$6.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { - var _this10 = this; + var _this11 = this; var target = getElementFromSelector(this); @@ -3376,8 +3396,8 @@ } EventHandler.one(target, Event$6.HIDDEN, function () { - if (isVisible(_this10)) { - _this10.focus(); + if (isVisible(_this11)) { + _this11.focus(); } }); }); @@ -5281,5 +5301,5 @@ return index_umd; -})); +}))); //# sourceMappingURL=bootstrap.js.map |