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

Move from $.proxy to es6 arrow functions. (#21049)

This commit is contained in:
Bardi Harborow
2016-11-01 14:32:36 +11:00
committed by Mark Otto
parent d6cc0e017d
commit 0974267b8c
6 changed files with 14 additions and 18 deletions

View File

@@ -133,7 +133,7 @@ const Modal = (($) => {
$(this._element).on(
Event.CLICK_DISMISS,
Selector.DATA_DISMISS,
$.proxy(this.hide, this)
(event) => this.hide(event)
)
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, () => {
@@ -144,9 +144,7 @@ const Modal = (($) => {
})
})
this._showBackdrop(
$.proxy(this._showElement, this, relatedTarget)
)
this._showBackdrop(() => this._showElement(relatedTarget))
}
hide(event) {
@@ -178,7 +176,7 @@ const Modal = (($) => {
($(this._element).hasClass(ClassName.FADE))) {
$(this._element)
.one(Util.TRANSITION_END, $.proxy(this._hideModal, this))
.one(Util.TRANSITION_END, (event) => this._hideModal(event))
.emulateTransitionEnd(TRANSITION_DURATION)
} else {
this._hideModal()
@@ -284,7 +282,7 @@ const Modal = (($) => {
_setResizeEvent() {
if (this._isShown) {
$(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this))
$(window).on(Event.RESIZE, (event) => this._handleUpdate(event))
} else {
$(window).off(Event.RESIZE)
}