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:
authorJacob Thornton <jacobthornton@gmail.com>2012-10-18 09:26:44 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-10-18 09:26:44 +0400
commitedc3eee5eaae52384de1486639585c0b41318cf8 (patch)
tree7c82af98402716dbbdd70d6ff2ff7a16648726b1 /docs/assets/js/bootstrap.js
parent8e6697f2b20da705377d2a7a2eb6957a4df59d77 (diff)
fix carousel event
Diffstat (limited to 'docs/assets/js/bootstrap.js')
-rw-r--r--docs/assets/js/bootstrap.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js
index e96798039e..1b2521a965 100644
--- a/docs/assets/js/bootstrap.js
+++ b/docs/assets/js/bootstrap.js
@@ -337,9 +337,7 @@
, direction = type == 'next' ? 'left' : 'right'
, fallback = type == 'next' ? 'first' : 'last'
, that = this
- , e = $.Event('slide', {
- relatedTarget: $next[0]
- })
+ , e
this.sliding = true
@@ -347,6 +345,10 @@
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
+ e = $.Event('slide', {
+ relatedTarget: $next[0]
+ })
+
if ($next.hasClass('active')) return
if ($.support.transition && this.$element.hasClass('slide')) {
@@ -410,7 +412,7 @@
$('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
- , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
+ , options = !$target.data('carousel') && $.extend({}, $target.data(), $this.data())
$target.carousel(options)
e.preventDefault()
})
@@ -1193,8 +1195,9 @@
this.enabled = !this.enabled
}
- , toggle: function () {
- this[this.tip().hasClass('in') ? 'hide' : 'show']()
+ , toggle: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+ self[self.tip().hasClass('in') ? 'hide' : 'show']()
}
, destroy: function () {