mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-27 05:49:07 +02:00
Move from $.proxy to es6 arrow functions. (#21049)
This commit is contained in:
committed by
Mark Otto
parent
d6cc0e017d
commit
0974267b8c
@@ -161,7 +161,7 @@ const Carousel = (($) => {
|
||||
|
||||
if (this._config.interval && !this._isPaused) {
|
||||
this._interval = setInterval(
|
||||
$.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval
|
||||
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -219,14 +219,14 @@ const Carousel = (($) => {
|
||||
_addEventListeners() {
|
||||
if (this._config.keyboard) {
|
||||
$(this._element)
|
||||
.on(Event.KEYDOWN, $.proxy(this._keydown, this))
|
||||
.on(Event.KEYDOWN, (event) => this._keydown(event))
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover' &&
|
||||
!('ontouchstart' in document.documentElement)) {
|
||||
$(this._element)
|
||||
.on(Event.MOUSEENTER, $.proxy(this.pause, this))
|
||||
.on(Event.MOUSELEAVE, $.proxy(this.cycle, this))
|
||||
.on(Event.MOUSEENTER, (event) => this.pause(event))
|
||||
.on(Event.MOUSELEAVE, (event) => this.cycle(event))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user