twitter-bootswatch-rails 3.2.0.0 → 3.3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.eot +0 -0
  3. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.svg +272 -213
  4. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.ttf +0 -0
  5. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff +0 -0
  6. data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
  7. data/app/assets/javascripts/twitter/bootstrap/affix.js +44 -24
  8. data/app/assets/javascripts/twitter/bootstrap/alert.js +7 -5
  9. data/app/assets/javascripts/twitter/bootstrap/button.js +17 -11
  10. data/app/assets/javascripts/twitter/bootstrap/carousel.js +31 -17
  11. data/app/assets/javascripts/twitter/bootstrap/collapse.js +70 -29
  12. data/app/assets/javascripts/twitter/bootstrap/dropdown.js +21 -11
  13. data/app/assets/javascripts/twitter/bootstrap/modal.js +68 -24
  14. data/app/assets/javascripts/twitter/bootstrap/popover.js +4 -4
  15. data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +13 -8
  16. data/app/assets/javascripts/twitter/bootstrap/tab.js +42 -17
  17. data/app/assets/javascripts/twitter/bootstrap/tooltip.js +54 -39
  18. data/app/assets/javascripts/twitter/bootstrap/transition.js +2 -2
  19. data/lib/generators/bootswatch/import/import_generator.rb +0 -4
  20. data/lib/generators/bootswatch/install/templates/variables.less.tt +33 -22
  21. data/lib/twitter/bootswatch/rails/version.rb +1 -1
  22. data/vendor/toolkit/twitter/bootstrap/alerts.less +5 -0
  23. data/vendor/toolkit/twitter/bootstrap/badges.less +11 -1
  24. data/vendor/toolkit/twitter/bootstrap/button-groups.less +18 -15
  25. data/vendor/toolkit/twitter/bootstrap/buttons.less +8 -5
  26. data/vendor/toolkit/twitter/bootstrap/carousel.less +26 -0
  27. data/vendor/toolkit/twitter/bootstrap/close.less +1 -0
  28. data/vendor/toolkit/twitter/bootstrap/code.less +1 -0
  29. data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -2
  30. data/vendor/toolkit/twitter/bootstrap/dropdowns.less +5 -6
  31. data/vendor/toolkit/twitter/bootstrap/forms.less +70 -44
  32. data/vendor/toolkit/twitter/bootstrap/glyphicons.less +69 -1
  33. data/vendor/toolkit/twitter/bootstrap/jumbotron.less +7 -5
  34. data/vendor/toolkit/twitter/bootstrap/list-group.less +1 -8
  35. data/vendor/toolkit/twitter/bootstrap/media.less +35 -30
  36. data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +2 -0
  37. data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +5 -1
  38. data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +2 -2
  39. data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -1
  40. data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +1 -1
  41. data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +6 -3
  42. data/vendor/toolkit/twitter/bootstrap/modals.less +3 -5
  43. data/vendor/toolkit/twitter/bootstrap/navbar.less +31 -25
  44. data/vendor/toolkit/twitter/bootstrap/navs.less +3 -1
  45. data/vendor/toolkit/twitter/bootstrap/normalize.less +5 -3
  46. data/vendor/toolkit/twitter/bootstrap/pager.less +1 -2
  47. data/vendor/toolkit/twitter/bootstrap/pagination.less +1 -1
  48. data/vendor/toolkit/twitter/bootstrap/panels.less +26 -4
  49. data/vendor/toolkit/twitter/bootstrap/popovers.less +6 -4
  50. data/vendor/toolkit/twitter/bootstrap/print.less +102 -96
  51. data/vendor/toolkit/twitter/bootstrap/progress-bars.less +1 -19
  52. data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +2 -1
  53. data/vendor/toolkit/twitter/bootstrap/scaffolding.less +1 -1
  54. data/vendor/toolkit/twitter/bootstrap/tables.less +14 -13
  55. data/vendor/toolkit/twitter/bootstrap/theme.less +26 -11
  56. data/vendor/toolkit/twitter/bootstrap/thumbnails.less +1 -1
  57. data/vendor/toolkit/twitter/bootstrap/tooltip.less +12 -4
  58. data/vendor/toolkit/twitter/bootstrap/type.less +0 -11
  59. data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -1
  60. data/vendor/toolkit/twitter/bootstrap/variables.less +33 -22
  61. metadata +33 -14
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: dropdown.js v3.2.0
2
+ * Bootstrap: dropdown.js v3.3.2
3
3
  * http://getbootstrap.com/javascript/#dropdowns
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
  $(element).on('click.bs.dropdown', this.toggle)
20
20
  }
21
21
 
22
- Dropdown.VERSION = '3.2.0'
22
+ Dropdown.VERSION = '3.3.2'
23
23
 
24
24
  Dropdown.prototype.toggle = function (e) {
25
25
  var $this = $(this)
@@ -42,7 +42,9 @@
42
42
 
43
43
  if (e.isDefaultPrevented()) return
44
44
 
45
- $this.trigger('focus')
45
+ $this
46
+ .trigger('focus')
47
+ .attr('aria-expanded', 'true')
46
48
 
47
49
  $parent
48
50
  .toggleClass('open')
@@ -53,7 +55,7 @@
53
55
  }
54
56
 
55
57
  Dropdown.prototype.keydown = function (e) {
56
- if (!/(38|40|27)/.test(e.keyCode)) return
58
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
57
59
 
58
60
  var $this = $(this)
59
61
 
@@ -65,7 +67,7 @@
65
67
  var $parent = getParent($this)
66
68
  var isActive = $parent.hasClass('open')
67
69
 
68
- if (!isActive || (isActive && e.keyCode == 27)) {
70
+ if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
69
71
  if (e.which == 27) $parent.find(toggle).trigger('focus')
70
72
  return $this.trigger('click')
71
73
  }
@@ -75,10 +77,10 @@
75
77
 
76
78
  if (!$items.length) return
77
79
 
78
- var index = $items.index($items.filter(':focus'))
80
+ var index = $items.index(e.target)
79
81
 
80
- if (e.keyCode == 38 && index > 0) index-- // up
81
- if (e.keyCode == 40 && index < $items.length - 1) index++ // down
82
+ if (e.which == 38 && index > 0) index-- // up
83
+ if (e.which == 40 && index < $items.length - 1) index++ // down
82
84
  if (!~index) index = 0
83
85
 
84
86
  $items.eq(index).trigger('focus')
@@ -88,11 +90,17 @@
88
90
  if (e && e.which === 3) return
89
91
  $(backdrop).remove()
90
92
  $(toggle).each(function () {
91
- var $parent = getParent($(this))
93
+ var $this = $(this)
94
+ var $parent = getParent($this)
92
95
  var relatedTarget = { relatedTarget: this }
96
+
93
97
  if (!$parent.hasClass('open')) return
98
+
94
99
  $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
100
+
95
101
  if (e.isDefaultPrevented()) return
102
+
103
+ $this.attr('aria-expanded', 'false')
96
104
  $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
97
105
  })
98
106
  }
@@ -146,6 +154,8 @@
146
154
  .on('click.bs.dropdown.data-api', clearMenus)
147
155
  .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
148
156
  .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
149
- .on('keydown.bs.dropdown.data-api', toggle + ', [role="menu"], [role="listbox"]', Dropdown.prototype.keydown)
157
+ .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
158
+ .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
159
+ .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
150
160
 
151
161
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: modal.js v3.2.0
2
+ * Bootstrap: modal.js v3.3.2
3
3
  * http://getbootstrap.com/javascript/#modals
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
 
@@ -30,7 +30,10 @@
30
30
  }
31
31
  }
32
32
 
33
- Modal.VERSION = '3.2.0'
33
+ Modal.VERSION = '3.3.2'
34
+
35
+ Modal.TRANSITION_DURATION = 300
36
+ Modal.BACKDROP_TRANSITION_DURATION = 150
34
37
 
35
38
  Modal.DEFAULTS = {
36
39
  backdrop: true,
@@ -53,10 +56,11 @@
53
56
  this.isShown = true
54
57
 
55
58
  this.checkScrollbar()
59
+ this.setScrollbar()
56
60
  this.$body.addClass('modal-open')
57
61
 
58
- this.setScrollbar()
59
62
  this.escape()
63
+ this.resize()
60
64
 
61
65
  this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
62
66
 
@@ -71,6 +75,9 @@
71
75
  .show()
72
76
  .scrollTop(0)
73
77
 
78
+ if (that.options.backdrop) that.adjustBackdrop()
79
+ that.adjustDialog()
80
+
74
81
  if (transition) {
75
82
  that.$element[0].offsetWidth // force reflow
76
83
  }
@@ -88,7 +95,7 @@
88
95
  .one('bsTransitionEnd', function () {
89
96
  that.$element.trigger('focus').trigger(e)
90
97
  })
91
- .emulateTransitionEnd(300) :
98
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
92
99
  that.$element.trigger('focus').trigger(e)
93
100
  })
94
101
  }
@@ -104,10 +111,8 @@
104
111
 
105
112
  this.isShown = false
106
113
 
107
- this.$body.removeClass('modal-open')
108
-
109
- this.resetScrollbar()
110
114
  this.escape()
115
+ this.resize()
111
116
 
112
117
  $(document).off('focusin.bs.modal')
113
118
 
@@ -119,7 +124,7 @@
119
124
  $.support.transition && this.$element.hasClass('fade') ?
120
125
  this.$element
121
126
  .one('bsTransitionEnd', $.proxy(this.hideModal, this))
122
- .emulateTransitionEnd(300) :
127
+ .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
123
128
  this.hideModal()
124
129
  }
125
130
 
@@ -135,11 +140,19 @@
135
140
 
136
141
  Modal.prototype.escape = function () {
137
142
  if (this.isShown && this.options.keyboard) {
138
- this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
143
+ this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
139
144
  e.which == 27 && this.hide()
140
145
  }, this))
141
146
  } else if (!this.isShown) {
142
- this.$element.off('keyup.dismiss.bs.modal')
147
+ this.$element.off('keydown.dismiss.bs.modal')
148
+ }
149
+ }
150
+
151
+ Modal.prototype.resize = function () {
152
+ if (this.isShown) {
153
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
154
+ } else {
155
+ $(window).off('resize.bs.modal')
143
156
  }
144
157
  }
145
158
 
@@ -147,6 +160,9 @@
147
160
  var that = this
148
161
  this.$element.hide()
149
162
  this.backdrop(function () {
163
+ that.$body.removeClass('modal-open')
164
+ that.resetAdjustments()
165
+ that.resetScrollbar()
150
166
  that.$element.trigger('hidden.bs.modal')
151
167
  })
152
168
  }
@@ -164,14 +180,13 @@
164
180
  var doAnimate = $.support.transition && animate
165
181
 
166
182
  this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
167
- .appendTo(this.$body)
168
-
169
- this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
170
- if (e.target !== e.currentTarget) return
171
- this.options.backdrop == 'static'
172
- ? this.$element[0].focus.call(this.$element[0])
173
- : this.hide.call(this)
174
- }, this))
183
+ .prependTo(this.$element)
184
+ .on('click.dismiss.bs.modal', $.proxy(function (e) {
185
+ if (e.target !== e.currentTarget) return
186
+ this.options.backdrop == 'static'
187
+ ? this.$element[0].focus.call(this.$element[0])
188
+ : this.hide.call(this)
189
+ }, this))
175
190
 
176
191
  if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
177
192
 
@@ -182,7 +197,7 @@
182
197
  doAnimate ?
183
198
  this.$backdrop
184
199
  .one('bsTransitionEnd', callback)
185
- .emulateTransitionEnd(150) :
200
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
186
201
  callback()
187
202
 
188
203
  } else if (!this.isShown && this.$backdrop) {
@@ -195,7 +210,7 @@
195
210
  $.support.transition && this.$element.hasClass('fade') ?
196
211
  this.$backdrop
197
212
  .one('bsTransitionEnd', callbackRemove)
198
- .emulateTransitionEnd(150) :
213
+ .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
199
214
  callbackRemove()
200
215
 
201
216
  } else if (callback) {
@@ -203,14 +218,43 @@
203
218
  }
204
219
  }
205
220
 
221
+ // these following methods are used to handle overflowing modals
222
+
223
+ Modal.prototype.handleUpdate = function () {
224
+ if (this.options.backdrop) this.adjustBackdrop()
225
+ this.adjustDialog()
226
+ }
227
+
228
+ Modal.prototype.adjustBackdrop = function () {
229
+ this.$backdrop
230
+ .css('height', 0)
231
+ .css('height', this.$element[0].scrollHeight)
232
+ }
233
+
234
+ Modal.prototype.adjustDialog = function () {
235
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
236
+
237
+ this.$element.css({
238
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
239
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
240
+ })
241
+ }
242
+
243
+ Modal.prototype.resetAdjustments = function () {
244
+ this.$element.css({
245
+ paddingLeft: '',
246
+ paddingRight: ''
247
+ })
248
+ }
249
+
206
250
  Modal.prototype.checkScrollbar = function () {
207
- if (document.body.clientWidth >= window.innerWidth) return
208
- this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
251
+ this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
252
+ this.scrollbarWidth = this.measureScrollbar()
209
253
  }
210
254
 
211
255
  Modal.prototype.setScrollbar = function () {
212
256
  var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
213
- if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
257
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
214
258
  }
215
259
 
216
260
  Modal.prototype.resetScrollbar = function () {
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: popover.js v3.2.0
2
+ * Bootstrap: popover.js v3.3.2
3
3
  * http://getbootstrap.com/javascript/#popovers
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
 
20
20
  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
21
21
 
22
- Popover.VERSION = '3.2.0'
22
+ Popover.VERSION = '3.3.2'
23
23
 
24
24
  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
25
25
  placement: 'right',
@@ -46,7 +46,7 @@
46
46
  var content = this.getContent()
47
47
 
48
48
  $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
49
- $tip.find('.popover-content').empty()[ // we use append for html objects to maintain js events
49
+ $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
50
50
  this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
51
51
  ](content)
52
52
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: scrollspy.js v3.2.0
2
+ * Bootstrap: scrollspy.js v3.3.2
3
3
  * http://getbootstrap.com/javascript/#scrollspy
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
 
@@ -30,7 +30,7 @@
30
30
  this.process()
31
31
  }
32
32
 
33
- ScrollSpy.VERSION = '3.2.0'
33
+ ScrollSpy.VERSION = '3.3.2'
34
34
 
35
35
  ScrollSpy.DEFAULTS = {
36
36
  offset: 10
@@ -91,8 +91,9 @@
91
91
  return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
92
92
  }
93
93
 
94
- if (activeTarget && scrollTop <= offsets[0]) {
95
- return activeTarget != (i = targets[0]) && this.activate(i)
94
+ if (activeTarget && scrollTop < offsets[0]) {
95
+ this.activeTarget = null
96
+ return this.clear()
96
97
  }
97
98
 
98
99
  for (i = offsets.length; i--;) {
@@ -106,9 +107,7 @@
106
107
  ScrollSpy.prototype.activate = function (target) {
107
108
  this.activeTarget = target
108
109
 
109
- $(this.selector)
110
- .parentsUntil(this.options.target, '.active')
111
- .removeClass('active')
110
+ this.clear()
112
111
 
113
112
  var selector = this.selector +
114
113
  '[data-target="' + target + '"],' +
@@ -127,6 +126,12 @@
127
126
  active.trigger('activate.bs.scrollspy')
128
127
  }
129
128
 
129
+ ScrollSpy.prototype.clear = function () {
130
+ $(this.selector)
131
+ .parentsUntil(this.options.target, '.active')
132
+ .removeClass('active')
133
+ }
134
+
130
135
 
131
136
  // SCROLLSPY PLUGIN DEFINITION
132
137
  // ===========================
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: tab.js v3.2.0
2
+ * Bootstrap: tab.js v3.3.2
3
3
  * http://getbootstrap.com/javascript/#tabs
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
 
@@ -17,7 +17,9 @@
17
17
  this.element = $(element)
18
18
  }
19
19
 
20
- Tab.VERSION = '3.2.0'
20
+ Tab.VERSION = '3.3.2'
21
+
22
+ Tab.TRANSITION_DURATION = 150
21
23
 
22
24
  Tab.prototype.show = function () {
23
25
  var $this = this.element
@@ -31,22 +33,30 @@
31
33
 
32
34
  if ($this.parent('li').hasClass('active')) return
33
35
 
34
- var previous = $ul.find('.active:last a')[0]
35
- var e = $.Event('show.bs.tab', {
36
- relatedTarget: previous
36
+ var $previous = $ul.find('.active:last a')
37
+ var hideEvent = $.Event('hide.bs.tab', {
38
+ relatedTarget: $this[0]
39
+ })
40
+ var showEvent = $.Event('show.bs.tab', {
41
+ relatedTarget: $previous[0]
37
42
  })
38
43
 
39
- $this.trigger(e)
44
+ $previous.trigger(hideEvent)
45
+ $this.trigger(showEvent)
40
46
 
41
- if (e.isDefaultPrevented()) return
47
+ if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return
42
48
 
43
49
  var $target = $(selector)
44
50
 
45
51
  this.activate($this.closest('li'), $ul)
46
52
  this.activate($target, $target.parent(), function () {
53
+ $previous.trigger({
54
+ type: 'hidden.bs.tab',
55
+ relatedTarget: $this[0]
56
+ })
47
57
  $this.trigger({
48
58
  type: 'shown.bs.tab',
49
- relatedTarget: previous
59
+ relatedTarget: $previous[0]
50
60
  })
51
61
  })
52
62
  }
@@ -55,15 +65,21 @@
55
65
  var $active = container.find('> .active')
56
66
  var transition = callback
57
67
  && $.support.transition
58
- && $active.hasClass('fade')
68
+ && (($active.length && $active.hasClass('fade')) || !!container.find('> .fade').length)
59
69
 
60
70
  function next() {
61
71
  $active
62
72
  .removeClass('active')
63
73
  .find('> .dropdown-menu > .active')
64
- .removeClass('active')
74
+ .removeClass('active')
75
+ .end()
76
+ .find('[data-toggle="tab"]')
77
+ .attr('aria-expanded', false)
65
78
 
66
- element.addClass('active')
79
+ element
80
+ .addClass('active')
81
+ .find('[data-toggle="tab"]')
82
+ .attr('aria-expanded', true)
67
83
 
68
84
  if (transition) {
69
85
  element[0].offsetWidth // reflow for transition
@@ -73,16 +89,21 @@
73
89
  }
74
90
 
75
91
  if (element.parent('.dropdown-menu')) {
76
- element.closest('li.dropdown').addClass('active')
92
+ element
93
+ .closest('li.dropdown')
94
+ .addClass('active')
95
+ .end()
96
+ .find('[data-toggle="tab"]')
97
+ .attr('aria-expanded', true)
77
98
  }
78
99
 
79
100
  callback && callback()
80
101
  }
81
102
 
82
- transition ?
103
+ $active.length && transition ?
83
104
  $active
84
105
  .one('bsTransitionEnd', next)
85
- .emulateTransitionEnd(150) :
106
+ .emulateTransitionEnd(Tab.TRANSITION_DURATION) :
86
107
  next()
87
108
 
88
109
  $active.removeClass('in')
@@ -120,9 +141,13 @@
120
141
  // TAB DATA-API
121
142
  // ============
122
143
 
123
- $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
144
+ var clickHandler = function (e) {
124
145
  e.preventDefault()
125
146
  Plugin.call($(this), 'show')
126
- })
147
+ }
148
+
149
+ $(document)
150
+ .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler)
151
+ .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler)
127
152
 
128
153
  }(jQuery);