twitter-bootswatch-rails 3.2.0.0 → 3.3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.eot +0 -0
- data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.svg +272 -213
- data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.ttf +0 -0
- data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff +0 -0
- data/app/assets/fonts/twitter/bootstrap/glyphicons-halflings-regular.woff2 +0 -0
- data/app/assets/javascripts/twitter/bootstrap/affix.js +44 -24
- data/app/assets/javascripts/twitter/bootstrap/alert.js +7 -5
- data/app/assets/javascripts/twitter/bootstrap/button.js +17 -11
- data/app/assets/javascripts/twitter/bootstrap/carousel.js +31 -17
- data/app/assets/javascripts/twitter/bootstrap/collapse.js +70 -29
- data/app/assets/javascripts/twitter/bootstrap/dropdown.js +21 -11
- data/app/assets/javascripts/twitter/bootstrap/modal.js +68 -24
- data/app/assets/javascripts/twitter/bootstrap/popover.js +4 -4
- data/app/assets/javascripts/twitter/bootstrap/scrollspy.js +13 -8
- data/app/assets/javascripts/twitter/bootstrap/tab.js +42 -17
- data/app/assets/javascripts/twitter/bootstrap/tooltip.js +54 -39
- data/app/assets/javascripts/twitter/bootstrap/transition.js +2 -2
- data/lib/generators/bootswatch/import/import_generator.rb +0 -4
- data/lib/generators/bootswatch/install/templates/variables.less.tt +33 -22
- data/lib/twitter/bootswatch/rails/version.rb +1 -1
- data/vendor/toolkit/twitter/bootstrap/alerts.less +5 -0
- data/vendor/toolkit/twitter/bootstrap/badges.less +11 -1
- data/vendor/toolkit/twitter/bootstrap/button-groups.less +18 -15
- data/vendor/toolkit/twitter/bootstrap/buttons.less +8 -5
- data/vendor/toolkit/twitter/bootstrap/carousel.less +26 -0
- data/vendor/toolkit/twitter/bootstrap/close.less +1 -0
- data/vendor/toolkit/twitter/bootstrap/code.less +1 -0
- data/vendor/toolkit/twitter/bootstrap/component-animations.less +5 -2
- data/vendor/toolkit/twitter/bootstrap/dropdowns.less +5 -6
- data/vendor/toolkit/twitter/bootstrap/forms.less +70 -44
- data/vendor/toolkit/twitter/bootstrap/glyphicons.less +69 -1
- data/vendor/toolkit/twitter/bootstrap/jumbotron.less +7 -5
- data/vendor/toolkit/twitter/bootstrap/list-group.less +1 -8
- data/vendor/toolkit/twitter/bootstrap/media.less +35 -30
- data/vendor/toolkit/twitter/bootstrap/mixins/buttons.less +2 -0
- data/vendor/toolkit/twitter/bootstrap/mixins/forms.less +5 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/grid-framework.less +2 -2
- data/vendor/toolkit/twitter/bootstrap/mixins/image.less +0 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/labels.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/mixins/vendor-prefixes.less +6 -3
- data/vendor/toolkit/twitter/bootstrap/modals.less +3 -5
- data/vendor/toolkit/twitter/bootstrap/navbar.less +31 -25
- data/vendor/toolkit/twitter/bootstrap/navs.less +3 -1
- data/vendor/toolkit/twitter/bootstrap/normalize.less +5 -3
- data/vendor/toolkit/twitter/bootstrap/pager.less +1 -2
- data/vendor/toolkit/twitter/bootstrap/pagination.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/panels.less +26 -4
- data/vendor/toolkit/twitter/bootstrap/popovers.less +6 -4
- data/vendor/toolkit/twitter/bootstrap/print.less +102 -96
- data/vendor/toolkit/twitter/bootstrap/progress-bars.less +1 -19
- data/vendor/toolkit/twitter/bootstrap/responsive-embed.less +2 -1
- data/vendor/toolkit/twitter/bootstrap/scaffolding.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/tables.less +14 -13
- data/vendor/toolkit/twitter/bootstrap/theme.less +26 -11
- data/vendor/toolkit/twitter/bootstrap/thumbnails.less +1 -1
- data/vendor/toolkit/twitter/bootstrap/tooltip.less +12 -4
- data/vendor/toolkit/twitter/bootstrap/type.less +0 -11
- data/vendor/toolkit/twitter/bootstrap/utilities.less +0 -1
- data/vendor/toolkit/twitter/bootstrap/variables.less +33 -22
- metadata +33 -14
@@ -1,8 +1,8 @@
|
|
1
1
|
/* ========================================================================
|
2
|
-
* Bootstrap: dropdown.js v3.2
|
2
|
+
* Bootstrap: dropdown.js v3.3.2
|
3
3
|
* http://getbootstrap.com/javascript/#dropdowns
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
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
|
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.
|
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.
|
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(
|
80
|
+
var index = $items.index(e.target)
|
79
81
|
|
80
|
-
if (e.
|
81
|
-
if (e.
|
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 $
|
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
|
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
|
2
|
+
* Bootstrap: modal.js v3.3.2
|
3
3
|
* http://getbootstrap.com/javascript/#modals
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
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(
|
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(
|
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('
|
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('
|
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
|
-
.
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
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(
|
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(
|
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
|
-
|
208
|
-
this.scrollbarWidth = this.
|
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.
|
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
|
2
|
+
* Bootstrap: popover.js v3.3.2
|
3
3
|
* http://getbootstrap.com/javascript/#popovers
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
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').
|
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
|
2
|
+
* Bootstrap: scrollspy.js v3.3.2
|
3
3
|
* http://getbootstrap.com/javascript/#scrollspy
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
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
|
95
|
-
|
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
|
-
|
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
|
2
|
+
* Bootstrap: tab.js v3.3.2
|
3
3
|
* http://getbootstrap.com/javascript/#tabs
|
4
4
|
* ========================================================================
|
5
|
-
* Copyright 2011-
|
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
|
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')
|
35
|
-
var
|
36
|
-
relatedTarget:
|
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
|
-
$
|
44
|
+
$previous.trigger(hideEvent)
|
45
|
+
$this.trigger(showEvent)
|
40
46
|
|
41
|
-
if (
|
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
|
-
|
74
|
+
.removeClass('active')
|
75
|
+
.end()
|
76
|
+
.find('[data-toggle="tab"]')
|
77
|
+
.attr('aria-expanded', false)
|
65
78
|
|
66
|
-
element
|
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
|
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(
|
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
|
-
|
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);
|