mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-11 18:02:28 +03:00
fix(plugins): save instance in constructor
This commit is contained in:
+5
-2
@@ -47,6 +47,9 @@ const ClassName = {
|
||||
class Alert {
|
||||
constructor(element) {
|
||||
this._element = element
|
||||
if (this._element) {
|
||||
Data.setData(element, DATA_KEY, this)
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
@@ -129,7 +132,6 @@ class Alert {
|
||||
|
||||
if (!data) {
|
||||
data = new Alert(this)
|
||||
Data.setData(this, DATA_KEY, data)
|
||||
}
|
||||
|
||||
if (config === 'close') {
|
||||
@@ -148,7 +150,8 @@ class Alert {
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
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()))
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user