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:
authorXhmikosR <xhmikosr@gmail.com>2017-07-27 13:39:55 +0300
committerXhmikosR <xhmikosr@gmail.com>2017-08-23 00:05:38 +0300
commitef8c77d8dcebd13559a141e419d003c2d10cc5f3 (patch)
treefa0efba9d60de5570eeac2b7ae0262916d64401d /js/src/scrollspy.js
parent0492c3a4cd0aed19f46c5472a54ee8700c1a328e (diff)
Tweak ESLint rules.
Diffstat (limited to 'js/src/scrollspy.js')
-rw-r--r--js/src/scrollspy.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index b70b7e477e..588f652988 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -231,7 +231,7 @@ const ScrollSpy = (($) => {
for (let i = this._offsets.length; i--;) {
const isActiveTarget = this._activeTarget !== this._targets[i]
&& scrollTop >= this._offsets[i]
- && (this._offsets[i + 1] === undefined ||
+ && (typeof this._offsets[i + 1] === 'undefined' ||
scrollTop < this._offsets[i + 1])
if (isActiveTarget) {
@@ -246,6 +246,7 @@ const ScrollSpy = (($) => {
this._clear()
let queries = this._selector.split(',')
+ // eslint-disable-next-line arrow-body-style
queries = queries.map((selector) => {
return `${selector}[data-target="${target}"],` +
`${selector}[href="${target}"]`
@@ -287,7 +288,7 @@ const ScrollSpy = (($) => {
}
if (typeof config === 'string') {
- if (data[config] === undefined) {
+ if (typeof data[config] === 'undefined') {
throw new Error(`No method named "${config}"`)
}
data[config]()