Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann-S <johann.servoire@gmail.com>2019-09-04 17:58:29 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-11-29 21:58:26 +0300
commit9f6b342dc710e4334b37ded90136efa1127a47cd (patch)
treecb5d8c8bddf356dd3f8c2289b99e9f9793fba6c7 /js/src/alert.js
parentc63aebc86ba05f0ebb420add653b80804c6a0cff (diff)
create a base component
Diffstat (limited to 'js/src/alert.js')
-rw-r--r--js/src/alert.js19
1 files changed, 6 insertions, 13 deletions
diff --git a/js/src/alert.js b/js/src/alert.js
index 724cda0173..6f4c0be8de 100644
--- a/js/src/alert.js
+++ b/js/src/alert.js
@@ -15,6 +15,7 @@ import {
} from './util/index'
import Data from './dom/data'
import EventHandler from './dom/event-handler'
+import BaseComponent from './base-component'
/**
* ------------------------------------------------------------------------
@@ -44,21 +45,17 @@ const CLASSNAME_SHOW = 'show'
* ------------------------------------------------------------------------
*/
-class Alert {
- constructor(element) {
- this._element = element
-
- if (this._element) {
- Data.setData(element, DATA_KEY, this)
- }
- }
-
+class Alert extends BaseComponent {
// Getters
static get VERSION() {
return VERSION
}
+ static get DATA_KEY() {
+ return DATA_KEY
+ }
+
// Public
close(element) {
@@ -134,10 +131,6 @@ class Alert {
alertInstance.close(this)
}
}
-
- static getInstance(element) {
- return Data.getData(element, DATA_KEY)
- }
}
/**