mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-26 06:44:35 +02:00
test(Modal): check if modal is disposed
This commit is contained in:
@@ -196,9 +196,17 @@ class Modal {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
[window, this._element, this._dialog]
|
||||
.forEach((htmlElement) => $(htmlElement).off(EVENT_KEY))
|
||||
|
||||
$(window, document, this._element, this._backdrop).off(EVENT_KEY)
|
||||
/**
|
||||
* `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
|
||||
* Do not move `document` in `htmlElements` array
|
||||
* It will remove `Event.CLICK_DATA_API` event that should remain
|
||||
*/
|
||||
$(document).off(Event.FOCUSIN)
|
||||
|
||||
$.removeData(this._element, DATA_KEY)
|
||||
|
||||
this._config = null
|
||||
this._element = null
|
||||
|
Reference in New Issue
Block a user