Skip to content

Commit

Permalink
grunt dist
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Jun 12, 2014
1 parent 6ac5708 commit b1a9168
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions dist/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
// =========================

var Carousel = function (element, options) {
this.$element = $(element)
this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.paused =
Expand All @@ -302,8 +302,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
this.$items = null

this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
.on('mouseleave', $.proxy(this.cycle, this))
.on('mouseenter.bs.carousel', $.proxy(this.pause, this))
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
}

Carousel.VERSION = '3.1.1'
Expand All @@ -314,6 +314,16 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re
wrap: true
}

Carousel.prototype.keydown = function (e) {
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
default: return
}

e.preventDefault()
}

Carousel.prototype.cycle = function (e) {
e || (this.paused = false)

Expand Down
Loading

0 comments on commit b1a9168

Please sign in to comment.