twitter-bootstrap-rails 3.2.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of twitter-bootstrap-rails might be problematic. Click here for more details.

Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +105 -130
  3. data/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  4. data/app/assets/fonts/glyphicons-halflings-regular.svg +273 -214
  5. data/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  6. data/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  7. data/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  8. data/app/assets/javascripts/twitter/bootstrap/affix.js +46 -26
  9. data/app/assets/javascripts/twitter/bootstrap/alert.js +7 -5
  10. data/app/assets/javascripts/twitter/bootstrap/button.js +27 -17
  11. data/app/assets/javascripts/twitter/bootstrap/carousel.js +35 -21
  12. data/app/assets/javascripts/twitter/bootstrap/collapse.js +68 -27
  13. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +55 -41
  14. data/app/assets/javascripts/twitter/bootstrap/modal.js +88 -31
  15. data/app/assets/javascripts/twitter/bootstrap/popover.js +5 -10
  16. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +28 -26
  17. data/app/assets/javascripts/twitter/bootstrap/tab.js +45 -18
  18. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +111 -54
  19. data/app/assets/javascripts/twitter/bootstrap/transition.js +2 -2
  20. data/app/helpers/glyph_helper.rb +6 -3
  21. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.css +3 -4
  22. data/lib/generators/bootstrap/install/templates/bootstrap_and_overrides.less +7 -18
  23. data/lib/generators/bootstrap/themed/templates/index.html.erb +2 -0
  24. data/lib/generators/bootstrap/themed/templates/index.html.haml +1 -0
  25. data/lib/generators/bootstrap/themed/templates/index.html.slim +2 -0
  26. data/lib/twitter/bootstrap/rails/version.rb +1 -1
  27. data/vendor/toolkit/twitter/bootstrap/alerts.less +5 -0
  28. data/vendor/toolkit/twitter/bootstrap/badges.less +14 -3
  29. data/vendor/toolkit/twitter/bootstrap/bootstrap.less +6 -0
  30. data/vendor/toolkit/twitter/bootstrap/breadcrumbs.less +0 -0
  31. data/vendor/toolkit/twitter/bootstrap/button-groups.less +13 -14
  32. data/vendor/toolkit/twitter/bootstrap/buttons.less +14 -7
  33. data/vendor/toolkit/twitter/bootstrap/carousel.less +34 -7
  34. data/vendor/toolkit/twitter/bootstrap/close.less +1 -0
  35. data/vendor/toolkit/twitter/bootstrap/code.less +0 -0
  36. data/vendor/toolkit/twitter/bootstrap/component-animations.less +3 -1
  37. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +9 -8
  38. data/vendor/toolkit/twitter/bootstrap/forms.less +110 -41
  39. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +80 -9
  40. data/vendor/toolkit/twitter/bootstrap/grid.less +0 -0
  41. data/vendor/toolkit/twitter/bootstrap/input-groups.less +8 -3
  42. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +10 -4
  43. data/vendor/toolkit/twitter/bootstrap/labels.less +0 -0
  44. data/vendor/toolkit/twitter/bootstrap/list-group.less +11 -13
  45. data/vendor/toolkit/twitter/bootstrap/media.less +40 -30
  46. data/vendor/toolkit/twitter/bootstrap/mixins.less +1 -0
  47. data/vendor/toolkit/twitter/bootstrap/mixins/alerts.less +0 -0
  48. data/vendor/toolkit/twitter/bootstrap/mixins/background-variant.less +2 -1
  49. data/vendor/toolkit/twitter/bootstrap/mixins/border-radius.less +0 -0
  50. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +19 -6
  51. data/vendor/toolkit/twitter/bootstrap/mixins/center-block.less +0 -0
  52. data/vendor/toolkit/twitter/bootstrap/mixins/clearfix.less +0 -0
  53. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +0 -0
  54. data/vendor/toolkit/twitter/bootstrap/mixins/gradients.less +0 -0
  55. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +4 -4
  56. data/vendor/toolkit/twitter/bootstrap/mixins/grid.less +4 -4
  57. data/vendor/toolkit/twitter/bootstrap/mixins/hide-text.less +2 -2
  58. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -0
  59. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +1 -1
  60. data/vendor/toolkit/twitter/bootstrap/mixins/list-group.less +2 -1
  61. data/vendor/toolkit/twitter/bootstrap/mixins/nav-divider.less +0 -0
  62. data/vendor/toolkit/twitter/bootstrap/mixins/nav-vertical-align.less +0 -0
  63. data/vendor/toolkit/twitter/bootstrap/mixins/opacity.less +0 -0
  64. data/vendor/toolkit/twitter/bootstrap/mixins/pagination.less +2 -1
  65. data/vendor/toolkit/twitter/bootstrap/mixins/panels.less +0 -0
  66. data/vendor/toolkit/twitter/bootstrap/mixins/progress-bar.less +0 -0
  67. data/vendor/toolkit/twitter/bootstrap/mixins/reset-filter.less +0 -0
  68. data/vendor/toolkit/twitter/bootstrap/mixins/reset-text.less +18 -0
  69. data/vendor/toolkit/twitter/bootstrap/mixins/resize.less +0 -0
  70. data/vendor/toolkit/twitter/bootstrap/mixins/responsive-visibility.less +1 -1
  71. data/vendor/toolkit/twitter/bootstrap/mixins/size.less +0 -0
  72. data/vendor/toolkit/twitter/bootstrap/mixins/tab-focus.less +0 -0
  73. data/vendor/toolkit/twitter/bootstrap/mixins/table-row.less +0 -0
  74. data/vendor/toolkit/twitter/bootstrap/mixins/text-emphasis.less +2 -1
  75. data/vendor/toolkit/twitter/bootstrap/mixins/text-overflow.less +0 -0
  76. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +8 -5
  77. data/vendor/toolkit/twitter/bootstrap/modals.less +3 -3
  78. data/vendor/toolkit/twitter/bootstrap/navbar.less +6 -1
  79. data/vendor/toolkit/twitter/bootstrap/navs.less +1 -1
  80. data/vendor/toolkit/twitter/bootstrap/normalize.less +12 -13
  81. data/vendor/toolkit/twitter/bootstrap/pager.less +1 -2
  82. data/vendor/toolkit/twitter/bootstrap/pagination.less +5 -4
  83. data/vendor/toolkit/twitter/bootstrap/panels.less +27 -4
  84. data/vendor/toolkit/twitter/bootstrap/popovers.less +5 -7
  85. data/vendor/toolkit/twitter/bootstrap/print.less +96 -96
  86. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +1 -14
  87. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +10 -9
  88. data/vendor/toolkit/twitter/bootstrap/responsive-utilities.less +0 -0
  89. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +12 -1
  90. data/vendor/toolkit/twitter/bootstrap/tables.less +6 -5
  91. data/vendor/toolkit/twitter/bootstrap/theme.less +47 -16
  92. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +1 -1
  93. data/vendor/toolkit/twitter/bootstrap/tooltip.less +13 -7
  94. data/vendor/toolkit/twitter/bootstrap/type.less +2 -8
  95. data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -1
  96. data/vendor/toolkit/twitter/bootstrap/variables.less +36 -14
  97. data/vendor/toolkit/twitter/bootstrap/wells.less +0 -0
  98. metadata +45 -56
  99. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  100. data/app/assets/fonts/fontawesome-webfont.svg +0 -640
  101. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  102. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  103. data/app/assets/stylesheets/twitter-bootstrap-static/fontawesome.css.erb +0 -2026
  104. data/vendor/static-source/fontawesome.less +0 -8
  105. data/vendor/toolkit/fontawesome/bordered-pulled.less +0 -16
  106. data/vendor/toolkit/fontawesome/core.less +0 -11
  107. data/vendor/toolkit/fontawesome/fixed-width.less +0 -6
  108. data/vendor/toolkit/fontawesome/font-awesome.less +0 -17
  109. data/vendor/toolkit/fontawesome/icons.less +0 -552
  110. data/vendor/toolkit/fontawesome/larger.less +0 -13
  111. data/vendor/toolkit/fontawesome/list.less +0 -19
  112. data/vendor/toolkit/fontawesome/mixins.less +0 -25
  113. data/vendor/toolkit/fontawesome/path.less +0 -14
  114. data/vendor/toolkit/fontawesome/rotated-flipped.less +0 -20
  115. data/vendor/toolkit/fontawesome/spinning.less +0 -29
  116. data/vendor/toolkit/fontawesome/stacked.less +0 -20
  117. data/vendor/toolkit/fontawesome/variables.less +0 -561
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.2.0
2
+ * Bootstrap: affix.js v3.3.6
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -21,14 +21,14 @@
21
21
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22
22
 
23
23
  this.$element = $(element)
24
- this.affixed =
25
- this.unpin =
24
+ this.affixed = null
25
+ this.unpin = null
26
26
  this.pinnedOffset = null
27
27
 
28
28
  this.checkPosition()
29
29
  }
30
30
 
31
- Affix.VERSION = '3.2.0'
31
+ Affix.VERSION = '3.3.6'
32
32
 
33
33
  Affix.RESET = 'affix affix-top affix-bottom'
34
34
 
@@ -37,6 +37,28 @@
37
37
  target: window
38
38
  }
39
39
 
40
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
41
+ var scrollTop = this.$target.scrollTop()
42
+ var position = this.$element.offset()
43
+ var targetHeight = this.$target.height()
44
+
45
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
46
+
47
+ if (this.affixed == 'bottom') {
48
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
49
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
50
+ }
51
+
52
+ var initializing = this.affixed == null
53
+ var colliderTop = initializing ? scrollTop : position.top
54
+ var colliderHeight = initializing ? targetHeight : height
55
+
56
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
57
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
58
+
59
+ return false
60
+ }
61
+
40
62
  Affix.prototype.getPinnedOffset = function () {
41
63
  if (this.pinnedOffset) return this.pinnedOffset
42
64
  this.$element.removeClass(Affix.RESET).addClass('affix')
@@ -52,42 +74,40 @@
52
74
  Affix.prototype.checkPosition = function () {
53
75
  if (!this.$element.is(':visible')) return
54
76
 
55
- var scrollHeight = $(document).height()
56
- var scrollTop = this.$target.scrollTop()
57
- var position = this.$element.offset()
77
+ var height = this.$element.height()
58
78
  var offset = this.options.offset
59
79
  var offsetTop = offset.top
60
80
  var offsetBottom = offset.bottom
81
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
61
82
 
62
83
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
63
84
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
64
85
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
65
86
 
66
- var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
67
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
68
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
87
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
69
88
 
70
- if (this.affixed === affix) return
71
- if (this.unpin != null) this.$element.css('top', '')
89
+ if (this.affixed != affix) {
90
+ if (this.unpin != null) this.$element.css('top', '')
72
91
 
73
- var affixType = 'affix' + (affix ? '-' + affix : '')
74
- var e = $.Event(affixType + '.bs.affix')
92
+ var affixType = 'affix' + (affix ? '-' + affix : '')
93
+ var e = $.Event(affixType + '.bs.affix')
75
94
 
76
- this.$element.trigger(e)
95
+ this.$element.trigger(e)
77
96
 
78
- if (e.isDefaultPrevented()) return
97
+ if (e.isDefaultPrevented()) return
79
98
 
80
- this.affixed = affix
81
- this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
99
+ this.affixed = affix
100
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
82
101
 
83
- this.$element
84
- .removeClass(Affix.RESET)
85
- .addClass(affixType)
86
- .trigger($.Event(affixType.replace('affix', 'affixed')))
102
+ this.$element
103
+ .removeClass(Affix.RESET)
104
+ .addClass(affixType)
105
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
106
+ }
87
107
 
88
108
  if (affix == 'bottom') {
89
109
  this.$element.offset({
90
- top: scrollHeight - this.$element.height() - offsetBottom
110
+ top: scrollHeight - height - offsetBottom
91
111
  })
92
112
  }
93
113
  }
@@ -132,8 +152,8 @@
132
152
 
133
153
  data.offset = data.offset || {}
134
154
 
135
- if (data.offsetBottom) data.offset.bottom = data.offsetBottom
136
- if (data.offsetTop) data.offset.top = data.offsetTop
155
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
156
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
137
157
 
138
158
  Plugin.call($spy, data)
139
159
  })
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.2.0
2
+ * Bootstrap: alert.js v3.3.6
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -18,7 +18,9 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
- Alert.VERSION = '3.2.0'
21
+ Alert.VERSION = '3.3.6'
22
+
23
+ Alert.TRANSITION_DURATION = 150
22
24
 
23
25
  Alert.prototype.close = function (e) {
24
26
  var $this = $(this)
@@ -34,7 +36,7 @@
34
36
  if (e) e.preventDefault()
35
37
 
36
38
  if (!$parent.length) {
37
- $parent = $this.hasClass('alert') ? $this : $this.parent()
39
+ $parent = $this.closest('.alert')
38
40
  }
39
41
 
40
42
  $parent.trigger(e = $.Event('close.bs.alert'))
@@ -51,7 +53,7 @@
51
53
  $.support.transition && $parent.hasClass('fade') ?
52
54
  $parent
53
55
  .one('bsTransitionEnd', removeElement)
54
- .emulateTransitionEnd(150) :
56
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
55
57
  removeElement()
56
58
  }
57
59
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.2.0
2
+ * Bootstrap: button.js v3.3.6
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
- Button.VERSION = '3.2.0'
22
+ Button.VERSION = '3.3.6'
23
23
 
24
24
  Button.DEFAULTS = {
25
25
  loadingText: 'loading...'
@@ -31,14 +31,14 @@
31
31
  var val = $el.is('input') ? 'val' : 'html'
32
32
  var data = $el.data()
33
33
 
34
- state = state + 'Text'
34
+ state += 'Text'
35
35
 
36
36
  if (data.resetText == null) $el.data('resetText', $el[val]())
37
37
 
38
- $el[val](data[state] == null ? this.options[state] : data[state])
39
-
40
38
  // push to event loop to allow forms to submit
41
39
  setTimeout($.proxy(function () {
40
+ $el[val](data[state] == null ? this.options[state] : data[state])
41
+
42
42
  if (state == 'loadingText') {
43
43
  this.isLoading = true
44
44
  $el.addClass(d).attr(d, d)
@@ -56,13 +56,19 @@
56
56
  if ($parent.length) {
57
57
  var $input = this.$element.find('input')
58
58
  if ($input.prop('type') == 'radio') {
59
- if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
60
- else $parent.find('.active').removeClass('active')
59
+ if ($input.prop('checked')) changed = false
60
+ $parent.find('.active').removeClass('active')
61
+ this.$element.addClass('active')
62
+ } else if ($input.prop('type') == 'checkbox') {
63
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
64
+ this.$element.toggleClass('active')
61
65
  }
62
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
66
+ $input.prop('checked', this.$element.hasClass('active'))
67
+ if (changed) $input.trigger('change')
68
+ } else {
69
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
70
+ this.$element.toggleClass('active')
63
71
  }
64
-
65
- if (changed) this.$element.toggleClass('active')
66
72
  }
67
73
 
68
74
 
@@ -100,11 +106,15 @@
100
106
  // BUTTON DATA-API
101
107
  // ===============
102
108
 
103
- $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
104
- var $btn = $(e.target)
105
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
106
- Plugin.call($btn, 'toggle')
107
- e.preventDefault()
108
- })
109
+ $(document)
110
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
111
+ var $btn = $(e.target)
112
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
113
+ Plugin.call($btn, 'toggle')
114
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
115
+ })
116
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
117
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
118
+ })
109
119
 
110
120
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.2.0
2
+ * Bootstrap: carousel.js v3.3.6
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -14,29 +14,35 @@
14
14
  // =========================
15
15
 
16
16
  var Carousel = function (element, options) {
17
- this.$element = $(element).on('keydown.bs.carousel', $.proxy(this.keydown, this))
17
+ this.$element = $(element)
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
- this.paused =
21
- this.sliding =
22
- this.interval =
23
- this.$active =
20
+ this.paused = null
21
+ this.sliding = null
22
+ this.interval = null
23
+ this.$active = null
24
24
  this.$items = null
25
25
 
26
- this.options.pause == 'hover' && this.$element
26
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
27
+
28
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
27
29
  .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
28
30
  .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
29
31
  }
30
32
 
31
- Carousel.VERSION = '3.2.0'
33
+ Carousel.VERSION = '3.3.6'
34
+
35
+ Carousel.TRANSITION_DURATION = 600
32
36
 
33
37
  Carousel.DEFAULTS = {
34
38
  interval: 5000,
35
39
  pause: 'hover',
36
- wrap: true
40
+ wrap: true,
41
+ keyboard: true
37
42
  }
38
43
 
39
44
  Carousel.prototype.keydown = function (e) {
45
+ if (/input|textarea/i.test(e.target.tagName)) return
40
46
  switch (e.which) {
41
47
  case 37: this.prev(); break
42
48
  case 39: this.next(); break
@@ -63,6 +69,16 @@
63
69
  return this.$items.index(item || this.$active)
64
70
  }
65
71
 
72
+ Carousel.prototype.getItemForDirection = function (direction, active) {
73
+ var activeIndex = this.getItemIndex(active)
74
+ var willWrap = (direction == 'prev' && activeIndex === 0)
75
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
76
+ if (willWrap && !this.options.wrap) return active
77
+ var delta = direction == 'prev' ? -1 : 1
78
+ var itemIndex = (activeIndex + delta) % this.$items.length
79
+ return this.$items.eq(itemIndex)
80
+ }
81
+
66
82
  Carousel.prototype.to = function (pos) {
67
83
  var that = this
68
84
  var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
@@ -72,7 +88,7 @@
72
88
  if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
73
89
  if (activeIndex == pos) return this.pause().cycle()
74
90
 
75
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
91
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
76
92
  }
77
93
 
78
94
  Carousel.prototype.pause = function (e) {
@@ -100,17 +116,11 @@
100
116
 
101
117
  Carousel.prototype.slide = function (type, next) {
102
118
  var $active = this.$element.find('.item.active')
103
- var $next = next || $active[type]()
119
+ var $next = next || this.getItemForDirection(type, $active)
104
120
  var isCycling = this.interval
105
121
  var direction = type == 'next' ? 'left' : 'right'
106
- var fallback = type == 'next' ? 'first' : 'last'
107
122
  var that = this
108
123
 
109
- if (!$next.length) {
110
- if (!this.options.wrap) return
111
- $next = this.$element.find('.item')[fallback]()
112
- }
113
-
114
124
  if ($next.hasClass('active')) return (this.sliding = false)
115
125
 
116
126
  var relatedTarget = $next[0]
@@ -146,7 +156,7 @@
146
156
  that.$element.trigger(slidEvent)
147
157
  }, 0)
148
158
  })
149
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
159
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
150
160
  } else {
151
161
  $active.removeClass('active')
152
162
  $next.addClass('active')
@@ -195,7 +205,7 @@
195
205
  // CAROUSEL DATA-API
196
206
  // =================
197
207
 
198
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
208
+ var clickHandler = function (e) {
199
209
  var href
200
210
  var $this = $(this)
201
211
  var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
@@ -211,7 +221,11 @@
211
221
  }
212
222
 
213
223
  e.preventDefault()
214
- })
224
+ }
225
+
226
+ $(document)
227
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
228
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
215
229
 
216
230
  $(window).on('load', function () {
217
231
  $('[data-ride="carousel"]').each(function () {
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: collapse.js v3.2.0
2
+ * Bootstrap: collapse.js v3.3.6
3
3
  * http://getbootstrap.com/javascript/#collapse
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -16,13 +16,22 @@
16
16
  var Collapse = function (element, options) {
17
17
  this.$element = $(element)
18
18
  this.options = $.extend({}, Collapse.DEFAULTS, options)
19
+ this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
20
+ '[data-toggle="collapse"][data-target="#' + element.id + '"]')
19
21
  this.transitioning = null
20
22
 
21
- if (this.options.parent) this.$parent = $(this.options.parent)
23
+ if (this.options.parent) {
24
+ this.$parent = this.getParent()
25
+ } else {
26
+ this.addAriaAndCollapsedClass(this.$element, this.$trigger)
27
+ }
28
+
22
29
  if (this.options.toggle) this.toggle()
23
30
  }
24
31
 
25
- Collapse.VERSION = '3.2.0'
32
+ Collapse.VERSION = '3.3.6'
33
+
34
+ Collapse.TRANSITION_DURATION = 350
26
35
 
27
36
  Collapse.DEFAULTS = {
28
37
  toggle: true
@@ -36,17 +45,21 @@
36
45
  Collapse.prototype.show = function () {
37
46
  if (this.transitioning || this.$element.hasClass('in')) return
38
47
 
48
+ var activesData
49
+ var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
50
+
51
+ if (actives && actives.length) {
52
+ activesData = actives.data('bs.collapse')
53
+ if (activesData && activesData.transitioning) return
54
+ }
55
+
39
56
  var startEvent = $.Event('show.bs.collapse')
40
57
  this.$element.trigger(startEvent)
41
58
  if (startEvent.isDefaultPrevented()) return
42
59
 
43
- var actives = this.$parent && this.$parent.find('> .panel > .in')
44
-
45
60
  if (actives && actives.length) {
46
- var hasData = actives.data('bs.collapse')
47
- if (hasData && hasData.transitioning) return
48
61
  Plugin.call(actives, 'hide')
49
- hasData || actives.data('bs.collapse', null)
62
+ activesData || actives.data('bs.collapse', null)
50
63
  }
51
64
 
52
65
  var dimension = this.dimension()
@@ -54,6 +67,11 @@
54
67
  this.$element
55
68
  .removeClass('collapse')
56
69
  .addClass('collapsing')[dimension](0)
70
+ .attr('aria-expanded', true)
71
+
72
+ this.$trigger
73
+ .removeClass('collapsed')
74
+ .attr('aria-expanded', true)
57
75
 
58
76
  this.transitioning = 1
59
77
 
@@ -72,7 +90,7 @@
72
90
 
73
91
  this.$element
74
92
  .one('bsTransitionEnd', $.proxy(complete, this))
75
- .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize])
93
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
76
94
  }
77
95
 
78
96
  Collapse.prototype.hide = function () {
@@ -88,17 +106,21 @@
88
106
 
89
107
  this.$element
90
108
  .addClass('collapsing')
91
- .removeClass('collapse')
92
- .removeClass('in')
109
+ .removeClass('collapse in')
110
+ .attr('aria-expanded', false)
111
+
112
+ this.$trigger
113
+ .addClass('collapsed')
114
+ .attr('aria-expanded', false)
93
115
 
94
116
  this.transitioning = 1
95
117
 
96
118
  var complete = function () {
97
119
  this.transitioning = 0
98
120
  this.$element
99
- .trigger('hidden.bs.collapse')
100
121
  .removeClass('collapsing')
101
122
  .addClass('collapse')
123
+ .trigger('hidden.bs.collapse')
102
124
  }
103
125
 
104
126
  if (!$.support.transition) return complete.call(this)
@@ -106,13 +128,40 @@
106
128
  this.$element
107
129
  [dimension](0)
108
130
  .one('bsTransitionEnd', $.proxy(complete, this))
109
- .emulateTransitionEnd(350)
131
+ .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
110
132
  }
111
133
 
112
134
  Collapse.prototype.toggle = function () {
113
135
  this[this.$element.hasClass('in') ? 'hide' : 'show']()
114
136
  }
115
137
 
138
+ Collapse.prototype.getParent = function () {
139
+ return $(this.options.parent)
140
+ .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
141
+ .each($.proxy(function (i, element) {
142
+ var $element = $(element)
143
+ this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
144
+ }, this))
145
+ .end()
146
+ }
147
+
148
+ Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
149
+ var isOpen = $element.hasClass('in')
150
+
151
+ $element.attr('aria-expanded', isOpen)
152
+ $trigger
153
+ .toggleClass('collapsed', !isOpen)
154
+ .attr('aria-expanded', isOpen)
155
+ }
156
+
157
+ function getTargetFromTrigger($trigger) {
158
+ var href
159
+ var target = $trigger.attr('data-target')
160
+ || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
161
+
162
+ return $(target)
163
+ }
164
+
116
165
 
117
166
  // COLLAPSE PLUGIN DEFINITION
118
167
  // ==========================
@@ -123,7 +172,7 @@
123
172
  var data = $this.data('bs.collapse')
124
173
  var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
125
174
 
126
- if (!data && options.toggle && option == 'show') option = !option
175
+ if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
127
176
  if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
128
177
  if (typeof option == 'string') data[option]()
129
178
  })
@@ -148,21 +197,13 @@
148
197
  // =================
149
198
 
150
199
  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
151
- var href
152
200
  var $this = $(this)
153
- var target = $this.attr('data-target')
154
- || e.preventDefault()
155
- || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7
156
- var $target = $(target)
201
+
202
+ if (!$this.attr('data-target')) e.preventDefault()
203
+
204
+ var $target = getTargetFromTrigger($this)
157
205
  var data = $target.data('bs.collapse')
158
206
  var option = data ? 'toggle' : $this.data()
159
- var parent = $this.attr('data-parent')
160
- var $parent = parent && $(parent)
161
-
162
- if (!data || !data.transitioning) {
163
- if ($parent) $parent.find('[data-toggle="collapse"][data-parent="' + parent + '"]').not($this).addClass('collapsed')
164
- $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
165
- }
166
207
 
167
208
  Plugin.call($target, option)
168
209
  })