1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-10 07:37:27 +02:00

Disable ESlint on no-return-assign and temporary for arrow-body-style

This commit is contained in:
Johann-S
2017-08-23 16:28:01 +02:00
committed by XhmikosR
parent 2970d14dd9
commit 4aef395e49
3 changed files with 9 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ class Alert {
const customEvent = this._triggerCloseEvent(rootElement)
if (customEvent.defaultPrevented) {
if (customEvent === null || customEvent.defaultPrevented) {
return
}

View File

@@ -16,8 +16,9 @@ if (!Element.prototype.matches) {
}
// closest polyfill (see: https://mzl.la/2vXggaI)
let fnClosest = null
if (!Element.prototype.closest) {
Element.prototype.closest = (element, selector) => {
fnClosest = (element, selector) => {
let ancestor = element
if (!document.documentElement.contains(element)) {
return null
@@ -33,10 +34,13 @@ if (!Element.prototype.closest) {
return null
}
} else {
// eslint-disable-next-line arrow-body-style
fnClosest = (element, selector) => {
return element.closest(selector)
}
}
const fnClosest = Element.prototype.closest
const SelectorEngine = {
matches(element, selector) {
return fnMatches.call(element, selector)
@@ -56,7 +60,7 @@ const SelectorEngine = {
},
closest(element, selector) {
return fnClosest.call(element, selector)
return fnClosest(element, selector)
}
}