1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 06:44:35 +02:00

remove old references to jquery and some fixes

This commit is contained in:
Johann-S
2018-03-11 16:18:56 +01:00
committed by XhmikosR
parent 0263d1742c
commit 7eddee286e
14 changed files with 44 additions and 56 deletions

View File

@@ -232,7 +232,7 @@ class Modal {
}
_showElement(relatedTarget) {
const transition = $(this._element).hasClass(ClassName.FADE)
const transition = this._element.classList.contains(ClassName.FADE)
if (!this._element.parentNode ||
this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
@@ -295,14 +295,14 @@ class Modal {
_setEscapeEvent() {
if (this._isShown && this._config.keyboard) {
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
EventHandler.on(this._element, Event.KEYDOWN_DISMISS, (event) => {
if (event.which === ESCAPE_KEYCODE) {
event.preventDefault()
this.hide()
}
})
} else if (!this._isShown) {
$(this._element).off(Event.KEYDOWN_DISMISS)
EventHandler.off(this._element, Event.KEYDOWN_DISMISS)
}
}