Skip to content

Commit

Permalink
Update to match bootstrap 2.3 from jlong/sass-twitter-bootstrap #54
Browse files Browse the repository at this point in the history
  • Loading branch information
trisweb committed Feb 9, 2013
1 parent 2d40e4d commit 07e7ec2
Show file tree
Hide file tree
Showing 41 changed files with 440 additions and 222 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ In your Gemfile:

```ruby
gem 'sass-rails', '~> 3.2'
gem 'bootstrap-sass', '~> 2.2.2.0'
gem 'bootstrap-sass', '~> 2.3.0.0'
```

#### CSS
Expand Down Expand Up @@ -115,7 +115,7 @@ Basically this means you should expect to append a separate patch version to the
### Bundler?

```ruby
gem 'bootstrap-sass', '~> 2.2.2.0'
gem 'bootstrap-sass', '~> 2.3.0.0'
```

Don't use the standard `~> 2.x.y`. Your apps may break.
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-sass.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "bootstrap-sass"
s.version = '2.2.2.0'
s.version = '2.3.0.0'
s.authors = ["Thomas McDonald"]
s.email = 'tom@conceptcoding.co.uk'
s.summary = "Twitter's Bootstrap, converted to Sass and ready to drop into Rails or Compass"
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-affix.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-affix.js v2.2.2
* bootstrap-affix.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#affix
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-alert.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-alert.js v2.2.2
* bootstrap-alert.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#alerts
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-button.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ============================================================
* bootstrap-button.js v2.2.2
* bootstrap-button.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================
* Copyright 2012 Twitter, Inc.
Expand Down
40 changes: 31 additions & 9 deletions vendor/assets/javascripts/bootstrap-carousel.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ==========================================================
* bootstrap-carousel.js v2.2.2
* bootstrap-carousel.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#carousel
* ==========================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -28,6 +28,7 @@

var Carousel = function (element, options) {
this.$element = $(element)
this.$indicators = this.$element.find('.carousel-indicators')
this.options = options
this.options.pause == 'hover' && this.$element
.on('mouseenter', $.proxy(this.pause, this))
Expand All @@ -38,31 +39,36 @@

cycle: function (e) {
if (!e) this.paused = false
if (this.interval) clearInterval(this.interval);
this.options.interval
&& !this.paused
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
return this
}

, getActiveIndex: function () {
this.$active = this.$element.find('.item.active')
this.$items = this.$active.parent().children()
return this.$items.index(this.$active)
}

, to: function (pos) {
var $active = this.$element.find('.item.active')
, children = $active.parent().children()
, activePos = children.index($active)
var activeIndex = this.getActiveIndex()
, that = this

if (pos > (children.length - 1) || pos < 0) return
if (pos > (this.$items.length - 1) || pos < 0) return

if (this.sliding) {
return this.$element.one('slid', function () {
that.to(pos)
})
}

if (activePos == pos) {
if (activeIndex == pos) {
return this.pause().cycle()
}

return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
}

, pause: function (e) {
Expand Down Expand Up @@ -103,10 +109,19 @@

e = $.Event('slide', {
relatedTarget: $next[0]
, direction: direction
})

if ($next.hasClass('active')) return

if (this.$indicators.length) {
this.$indicators.find('.active').removeClass('active')
this.$element.one('slid', function () {
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
$nextIndicator && $nextIndicator.addClass('active')
})
}

if ($.support.transition && this.$element.hasClass('slide')) {
this.$element.trigger(e)
if (e.isDefaultPrevented()) return
Expand Down Expand Up @@ -151,7 +166,7 @@
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
if (typeof option == 'number') data.to(option)
else if (action) data[action]()
else if (options.interval) data.cycle()
else if (options.interval) data.pause().cycle()
})
}

Expand All @@ -174,11 +189,18 @@
/* CAROUSEL DATA-API
* ================= */

$(document).on('click.carousel.data-api', '[data-slide]', function (e) {
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
var $this = $(this), href
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
, options = $.extend({}, $target.data(), $this.data())
, slideIndex

$target.carousel(options)

if (slideIndex = $this.attr('data-slide-to')) {
$target.data('carousel').pause().to(slideIndex).cycle()
}

e.preventDefault()
})

Expand Down
8 changes: 4 additions & 4 deletions vendor/assets/javascripts/bootstrap-collapse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* =============================================================
* bootstrap-collapse.js v2.2.2
* bootstrap-collapse.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#collapse
* =============================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -52,7 +52,7 @@
, actives
, hasData

if (this.transitioning) return
if (this.transitioning || this.$element.hasClass('in')) return

dimension = this.dimension()
scroll = $.camelCase(['scroll', dimension].join('-'))
Expand All @@ -72,7 +72,7 @@

, hide: function () {
var dimension
if (this.transitioning) return
if (this.transitioning || !this.$element.hasClass('in')) return
dimension = this.dimension()
this.reset(this.$element[dimension]())
this.transition('removeClass', $.Event('hide'), 'hidden')
Expand Down Expand Up @@ -129,7 +129,7 @@
return this.each(function () {
var $this = $(this)
, data = $this.data('collapse')
, options = typeof option == 'object' && option
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
if (typeof option == 'string') data[option]()
})
Expand Down
24 changes: 14 additions & 10 deletions vendor/assets/javascripts/bootstrap-dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ============================================================
* bootstrap-dropdown.js v2.2.2
* bootstrap-dropdown.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -81,7 +81,10 @@

isActive = $parent.hasClass('open')

if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}

$items = $('[role=menu] li:not(.divider):visible a', $parent)

Expand Down Expand Up @@ -115,8 +118,9 @@
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}

$parent = $(selector)
$parent.length || ($parent = $this.parent())
$parent = selector && $(selector)

if (!$parent || !$parent.length) $parent = $this.parent()

return $parent
}
Expand Down Expand Up @@ -152,10 +156,10 @@
* =================================== */

$(document)
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
.on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('.dropdown-menu', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)

}(window.jQuery);
}(window.jQuery);
24 changes: 13 additions & 11 deletions vendor/assets/javascripts/bootstrap-modal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* =========================================================
* bootstrap-modal.js v2.2.2
* bootstrap-modal.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#modals
* =========================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -60,8 +60,7 @@
that.$element.appendTo(document.body) //don't move modals dom position
}

that.$element
.show()
that.$element.show()

if (transition) {
that.$element[0].offsetWidth // force reflow
Expand Down Expand Up @@ -139,12 +138,13 @@
})
}

, hideModal: function (that) {
this.$element
.hide()
.trigger('hidden')

this.backdrop()
, hideModal: function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.removeBackdrop()
that.$element.trigger('hidden')
})
}

, removeBackdrop: function () {
Expand Down Expand Up @@ -172,6 +172,8 @@

this.$backdrop.addClass('in')

if (!callback) return

doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
callback()
Expand All @@ -180,8 +182,8 @@
this.$backdrop.removeClass('in')

$.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
this.removeBackdrop()
this.$backdrop.one($.support.transition.end, callback) :
callback()

} else if (callback) {
callback()
Expand Down
10 changes: 5 additions & 5 deletions vendor/assets/javascripts/bootstrap-popover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ===========================================================
* bootstrap-popover.js v2.2.2
* bootstrap-popover.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#popovers
* ===========================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -58,8 +58,8 @@
, $e = this.$element
, o = this.options

content = $e.attr('data-content')
|| (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|| $e.attr('data-content')

return content
}
Expand Down Expand Up @@ -99,7 +99,7 @@
placement: 'right'
, trigger: 'click'
, content: ''
, template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
})


Expand All @@ -111,4 +111,4 @@
return this
}

}(window.jQuery);
}(window.jQuery);
4 changes: 2 additions & 2 deletions vendor/assets/javascripts/bootstrap-scrollspy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* =============================================================
* bootstrap-scrollspy.js v2.2.2
* bootstrap-scrollspy.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#scrollspy
* =============================================================
* Copyright 2012 Twitter, Inc.
Expand Down Expand Up @@ -59,7 +59,7 @@
, $href = /^#\w/.test(href) && $(href)
return ( $href
&& $href.length
&& [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
})
.sort(function (a, b) { return a[0] - b[0] })
.each(function () {
Expand Down
2 changes: 1 addition & 1 deletion vendor/assets/javascripts/bootstrap-tab.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ========================================================
* bootstrap-tab.js v2.2.2
* bootstrap-tab.js v2.3.0
* http://twitter.github.com/bootstrap/javascript.html#tabs
* ========================================================
* Copyright 2012 Twitter, Inc.
Expand Down
Loading

0 comments on commit 07e7ec2

Please sign in to comment.