aboutsummaryrefslogtreecommitdiff
path: root/js/src
diff options
context:
space:
mode:
authorfat <[email protected]>2015-05-12 16:52:54 -0700
committerfat <[email protected]>2015-05-12 16:52:54 -0700
commitab1578465aee4a776412b48f16bfefca79381919 (patch)
tree0766caa82a67cd6328273aa5f2a826c579d44d32 /js/src
parenta58febf71a5eac2161ce2db08c7d723755ed1163 (diff)
downloadbootstrap-ab1578465aee4a776412b48f16bfefca79381919.tar.xz
bootstrap-ab1578465aee4a776412b48f16bfefca79381919.zip
grunt test-js, grunt dist-js now working
Diffstat (limited to 'js/src')
-rw-r--r--js/src/carousel.js8
-rw-r--r--js/src/modal.js8
-rw-r--r--js/src/scrollspy.js2
-rw-r--r--js/src/tab.js10
-rw-r--r--js/src/tooltip.js6
5 files changed, 20 insertions, 14 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index bce51d7fd..8c9b45247 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -139,7 +139,7 @@ const Carousel = (($) => {
if (this._config.interval && !this._isPaused) {
this._interval = setInterval(
- this.next.bind(this), this._config.interval
+ $.proxy(this.next, this), this._config.interval
)
}
}
@@ -177,14 +177,14 @@ const Carousel = (($) => {
_addEventListeners() {
if (this._config.keyboard) {
$(this._element)
- .on('keydown.bs.carousel', this._keydown.bind(this))
+ .on('keydown.bs.carousel', $.proxy(this._keydown, this))
}
if (this._config.pause == 'hover' &&
!('ontouchstart' in document.documentElement)) {
$(this._element)
- .on('mouseenter.bs.carousel', this.pause.bind(this))
- .on('mouseleave.bs.carousel', this.cycle.bind(this))
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}
}
diff --git a/js/src/modal.js b/js/src/modal.js
index b2e8fd77f..300ea2a7f 100644
--- a/js/src/modal.js
+++ b/js/src/modal.js
@@ -121,7 +121,7 @@ const Modal = (($) => {
$(this._element).on(
Event.DISMISS,
Selector.DATA_DISMISS,
- this.hide.bind(this)
+ $.proxy(this.hide, this)
)
$(this._dialog).on(Event.MOUSEDOWN, () => {
@@ -133,7 +133,7 @@ const Modal = (($) => {
})
this._showBackdrop(
- this._showElement.bind(this, relatedTarget)
+ $.proxy(this._showElement, this, relatedTarget)
)
}
@@ -166,7 +166,7 @@ const Modal = (($) => {
($(this._element).hasClass(ClassName.FADE))) {
$(this._element)
- .one(Util.TRANSITION_END, this._hideModal.bind(this))
+ .one(Util.TRANSITION_END, $.proxy(this._hideModal, this))
.emulateTransitionEnd(TRANSITION_DURATION)
} else {
this._hideModal()
@@ -241,7 +241,7 @@ const Modal = (($) => {
_setResizeEvent() {
if (this._isShown) {
- $(window).on(Event.RESIZE, this._handleUpdate.bind(this))
+ $(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this))
} else {
$(window).off(Event.RESIZE)
}
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index e41a3ae12..763d133e8 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -62,7 +62,7 @@ const ScrollSpy = (($) => {
this._activeTarget = null
this._scrollHeight = 0
- $(this._scrollElement).on(Event.SCROLL, this._process.bind(this))
+ $(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this))
this.refresh()
this._process()
diff --git a/js/src/tab.js b/js/src/tab.js
index 4668ff9e6..f6b174ce2 100644
--- a/js/src/tab.js
+++ b/js/src/tab.js
@@ -156,8 +156,14 @@ const Tab = (($) => {
&& ((active && $(active).hasClass(ClassName.FADE))
|| !!$(container).find(Selector.FADE_CHILD)[0])
- let complete = this._transitionComplete.bind(
- this, element, active, isTransitioning, callback)
+ let complete = $.proxy(
+ this._transitionComplete,
+ this,
+ element,
+ active,
+ isTransitioning,
+ callback
+ )
if (active && isTransitioning) {
$(active)
diff --git a/js/src/tooltip.js b/js/src/tooltip.js
index a04085130..1bd018c0f 100644
--- a/js/src/tooltip.js
+++ b/js/src/tooltip.js
@@ -373,7 +373,7 @@ const Tooltip = (($) => {
$(this.element).on(
this.constructor.Event.CLICK,
this.config.selector,
- this.toggle.bind(this)
+ $.proxy(this.toggle, this)
)
} else if (trigger !== Trigger.MANUAL) {
@@ -388,12 +388,12 @@ const Tooltip = (($) => {
.on(
eventIn,
this.config.selector,
- this._enter.bind(this)
+ $.proxy(this._enter, this)
)
.on(
eventOut,
this.config.selector,
- this._leave.bind(this)
+ $.proxy(this._leave, this)
)
}
})