aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/src/alert.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/alert.js')
-rw-r--r--vendor/twbs/bootstrap/js/src/alert.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/vendor/twbs/bootstrap/js/src/alert.js b/vendor/twbs/bootstrap/js/src/alert.js
index 87cc7e731..75dbec71b 100644
--- a/vendor/twbs/bootstrap/js/src/alert.js
+++ b/vendor/twbs/bootstrap/js/src/alert.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.1): alert.js
+ * Bootstrap (v5.0.2): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -9,7 +9,6 @@ import {
defineJQueryPlugin,
getElementFromSelector
} from './util/index'
-import Data from './dom/data'
import EventHandler from './dom/event-handler'
import BaseComponent from './base-component'
@@ -78,9 +77,7 @@ class Alert extends BaseComponent {
}
_destroyElement(element) {
- if (element.parentNode) {
- element.parentNode.removeChild(element)
- }
+ element.remove()
EventHandler.trigger(element, EVENT_CLOSED)
}
@@ -89,11 +86,7 @@ class Alert extends BaseComponent {
static jQueryInterface(config) {
return this.each(function () {
- let data = Data.get(this, DATA_KEY)
-
- if (!data) {
- data = new Alert(this)
- }
+ const data = Alert.getOrCreateInstance(this)
if (config === 'close') {
data[config](this)