diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-03-28 13:29:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 13:29:08 +0300 |
commit | 74afe149c48e8386c4de2bbd8fab36142227f755 (patch) | |
tree | cc1bddb6ace670de15e5fd58ecdf2fa856a05bf9 /js/dist/alert.js | |
parent | f761d8e801ddb972ca2a694a27d16c0244a59d94 (diff) |
Dist (#29924)
Diffstat (limited to 'js/dist/alert.js')
-rw-r--r-- | js/dist/alert.js | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/js/dist/alert.js b/js/dist/alert.js index 42c1ecfd57..7bc4bef2fb 100644 --- a/js/dist/alert.js +++ b/js/dist/alert.js @@ -1,6 +1,6 @@ /*! * Bootstrap alert.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) { @@ -9,9 +9,9 @@ (global = global || self, global.Alert = factory(global.Data, global.EventHandler, global.SelectorEngine)); }(this, (function (Data, EventHandler, SelectorEngine) { 'use strict'; - Data = Data && Data.hasOwnProperty('default') ? Data['default'] : Data; - EventHandler = EventHandler && EventHandler.hasOwnProperty('default') ? EventHandler['default'] : EventHandler; - SelectorEngine = SelectorEngine && SelectorEngine.hasOwnProperty('default') ? SelectorEngine['default'] : SelectorEngine; + Data = Data && Object.prototype.hasOwnProperty.call(Data, 'default') ? Data['default'] : Data; + EventHandler = EventHandler && Object.prototype.hasOwnProperty.call(EventHandler, 'default') ? EventHandler['default'] : EventHandler; + SelectorEngine = SelectorEngine && Object.prototype.hasOwnProperty.call(SelectorEngine, 'default') ? SelectorEngine['default'] : SelectorEngine; function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { @@ -78,9 +78,7 @@ }; var triggerTransitionEnd = function triggerTransitionEnd(element) { - var evt = document.createEvent('HTMLEvents'); - evt.initEvent(TRANSITION_END, true, true); - element.dispatchEvent(evt); + element.dispatchEvent(new Event(TRANSITION_END)); }; var emulateTransitionEnd = function emulateTransitionEnd(element, duration) { @@ -123,28 +121,20 @@ var DATA_KEY = 'bs.alert'; var EVENT_KEY = "." + DATA_KEY; var DATA_API_KEY = '.data-api'; - var Selector = { - DISMISS: '[data-dismiss="alert"]' - }; - var Event = { - CLOSE: "close" + EVENT_KEY, - CLOSED: "closed" + EVENT_KEY, - CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY - }; - var ClassName = { - ALERT: 'alert', - FADE: 'fade', - SHOW: 'show' - }; + var SELECTOR_DISMISS = '[data-dismiss="alert"]'; + var EVENT_CLOSE = "close" + EVENT_KEY; + var EVENT_CLOSED = "closed" + EVENT_KEY; + var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY; + var CLASSNAME_ALERT = 'alert'; + var CLASSNAME_FADE = 'fade'; + var CLASSNAME_SHOW = 'show'; /** * ------------------------------------------------------------------------ * Class Definition * ------------------------------------------------------------------------ */ - var Alert = - /*#__PURE__*/ - function () { + var Alert = /*#__PURE__*/function () { function Alert(element) { this._element = element; @@ -183,22 +173,22 @@ var parent = getElementFromSelector(element); if (!parent) { - parent = SelectorEngine.closest(element, "." + ClassName.ALERT); + parent = SelectorEngine.closest(element, "." + CLASSNAME_ALERT); } return parent; }; _proto._triggerCloseEvent = function _triggerCloseEvent(element) { - return EventHandler.trigger(element, Event.CLOSE); + return EventHandler.trigger(element, EVENT_CLOSE); }; _proto._removeElement = function _removeElement(element) { var _this = this; - element.classList.remove(ClassName.SHOW); + element.classList.remove(CLASSNAME_SHOW); - if (!element.classList.contains(ClassName.FADE)) { + if (!element.classList.contains(CLASSNAME_FADE)) { this._destroyElement(element); return; @@ -216,7 +206,7 @@ element.parentNode.removeChild(element); } - EventHandler.trigger(element, Event.CLOSED); + EventHandler.trigger(element, EVENT_CLOSED); } // Static ; @@ -264,7 +254,7 @@ */ - EventHandler.on(document, Event.CLICK_DATA_API, Selector.DISMISS, Alert.handleDismiss(new Alert())); + EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert())); var $ = getjQuery(); /** * ------------------------------------------------------------------------ |