diff options
Diffstat (limited to 'js/dist/dom/polyfill.js')
-rw-r--r-- | js/dist/dom/polyfill.js | 73 |
1 files changed, 3 insertions, 70 deletions
diff --git a/js/dist/dom/polyfill.js b/js/dist/dom/polyfill.js index a194e9fb9d..59a10a76cf 100644 --- a/js/dist/dom/polyfill.js +++ b/js/dist/dom/polyfill.js @@ -1,6 +1,6 @@ /*! * Bootstrap polyfill.js v4.3.1 (https://getbootstrap.com/) - * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ (function (global, factory) { @@ -32,58 +32,11 @@ }; /* istanbul ignore file */ - var _Element$prototype = Element.prototype; - exports.matches = _Element$prototype.matches; - exports.closest = _Element$prototype.closest; exports.find = Element.prototype.querySelectorAll; - exports.findOne = Element.prototype.querySelector; - - exports.createCustomEvent = function createCustomEvent(eventName, params) { - var cEvent = new CustomEvent(eventName, params); - return cEvent; - }; - - if (typeof window.CustomEvent !== 'function') { - exports.createCustomEvent = function createCustomEvent(eventName, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: null - }; - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail); - return evt; - }; - } - - var workingDefaultPrevented = function () { - var e = document.createEvent('CustomEvent'); - e.initEvent('Bootstrap', true, true); - e.preventDefault(); - return e.defaultPrevented; - }(); - - if (!workingDefaultPrevented) { - var origPreventDefault = Event.prototype.preventDefault; - - Event.prototype.preventDefault = function () { - if (!this.cancelable) { - return; - } - - origPreventDefault.call(this); - Object.defineProperty(this, 'defaultPrevented', { - get: function get() { - return true; - }, - configurable: true - }); - }; - } // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached - + exports.findOne = Element.prototype.querySelector; // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached var defaultPreventedPreservedOnDispatch = function () { - var e = exports.createCustomEvent('Bootstrap', { + var e = new CustomEvent('Bootstrap', { cancelable: true }); var element = document.createElement('div'); @@ -95,26 +48,6 @@ return e.defaultPrevented; }(); - if (!exports.matches) { - exports.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - } - - if (!exports.closest) { - exports.closest = function closest(selector) { - var element = this; - - do { - if (exports.matches.call(element, selector)) { - return element; - } - - element = element.parentElement || element.parentNode; - } while (element !== null && element.nodeType === 1); - - return null; - }; - } - var scopeSelectorRegex = /:scope\b/; var supportScopeQuery = function () { |