Skip to content

Commit c649c78

Browse files
committed
Merge branch 'release/3.0.3'
* release/3.0.3: Bump version to 3.0.3.0 Update test for changed comment style Bootstrap 3.0.3 stylesheets Boostrap 3.0.3 javascripts Update the README Add options to choose CSS and JS components in generator import variables before base update documentation with generator add generator to be able to override stylesheets
2 parents d8bc844 + 8f57aaa commit c649c78

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+384
-339
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ within `.css.scss` files.
6767
}
6868
```
6969

70+
You can also use the generator to generate custom bootstrap includes to override your variables and load only
71+
the components you need.
72+
73+
```
74+
rails generate bootstrap:customize
75+
```
76+
77+
Then you just need to include the bootstrap-custom file in your application.css
78+
79+
```css
80+
@import "bootstrap-custom";
81+
```
82+
83+
The generator has a `--css-components` option that includes all available bootstrap components in the
84+
custom include file. You can pick and choose what you need from there. There can be dependencies between
85+
the different components, please check the Bootstrap homepage for details.
86+
87+
For the Javascript components there is a `--js-components` option. The same rules as for the CSS components
88+
apply, if you are unsure about the order and dependencies please check the upstream homepage.
89+
7090
### Javascripts
7191

7292
Using the JavaScript works the same way. You can include them all with a

app/assets/javascripts/twitter/bootstrap/affix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: affix.js v3.0.2
2+
* Bootstrap: affix.js v3.0.3
33
* http://getbootstrap.com/javascript/#affix
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: alert.js v3.0.2
2+
* Bootstrap: alert.js v3.0.3
33
* http://getbootstrap.com/javascript/#alerts
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/button.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: button.js v3.0.2
2+
* Bootstrap: button.js v3.0.3
33
* http://getbootstrap.com/javascript/#buttons
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.
@@ -54,15 +54,21 @@
5454

5555
Button.prototype.toggle = function () {
5656
var $parent = this.$element.closest('[data-toggle="buttons"]')
57+
var changed = true
5758

5859
if ($parent.length) {
5960
var $input = this.$element.find('input')
60-
.prop('checked', !this.$element.hasClass('active'))
61-
.trigger('change')
62-
if ($input.prop('type') === 'radio') $parent.find('.active').removeClass('active')
61+
if ($input.prop('type') === 'radio') {
62+
// see if clicking on current one
63+
if ($input.prop('checked') && this.$element.hasClass('active'))
64+
changed = false
65+
else
66+
$parent.find('.active').removeClass('active')
67+
}
68+
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
6369
}
6470

65-
this.$element.toggleClass('active')
71+
if (changed) this.$element.toggleClass('active')
6672
}
6773

6874

app/assets/javascripts/twitter/bootstrap/carousel.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: carousel.js v3.0.2
2+
* Bootstrap: carousel.js v3.0.3
33
* http://getbootstrap.com/javascript/#carousel
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.
@@ -69,7 +69,7 @@
6969

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

72-
if (this.sliding) return this.$element.one('slid', function () { that.to(pos) })
72+
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
7373
if (activeIndex == pos) return this.pause().cycle()
7474

7575
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
@@ -121,7 +121,7 @@
121121

122122
if (this.$indicators.length) {
123123
this.$indicators.find('.active').removeClass('active')
124-
this.$element.one('slid', function () {
124+
this.$element.one('slid.bs.carousel', function () {
125125
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
126126
$nextIndicator && $nextIndicator.addClass('active')
127127
})
@@ -139,7 +139,7 @@
139139
$next.removeClass([type, direction].join(' ')).addClass('active')
140140
$active.removeClass(['active', direction].join(' '))
141141
that.sliding = false
142-
setTimeout(function () { that.$element.trigger('slid') }, 0)
142+
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
143143
})
144144
.emulateTransitionEnd(600)
145145
} else {
@@ -148,7 +148,7 @@
148148
$active.removeClass('active')
149149
$next.addClass('active')
150150
this.sliding = false
151-
this.$element.trigger('slid')
151+
this.$element.trigger('slid.bs.carousel')
152152
}
153153

154154
isCycling && this.cycle()

app/assets/javascripts/twitter/bootstrap/collapse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: collapse.js v3.0.2
2+
* Bootstrap: collapse.js v3.0.3
33
* http://getbootstrap.com/javascript/#collapse
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/dropdown.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: dropdown.js v3.0.2
2+
* Bootstrap: dropdown.js v3.0.3
33
* http://getbootstrap.com/javascript/#dropdowns
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.
@@ -26,7 +26,7 @@
2626
var backdrop = '.dropdown-backdrop'
2727
var toggle = '[data-toggle=dropdown]'
2828
var Dropdown = function (element) {
29-
var $el = $(element).on('click.bs.dropdown', this.toggle)
29+
$(element).on('click.bs.dropdown', this.toggle)
3030
}
3131

3232
Dropdown.prototype.toggle = function (e) {
@@ -41,7 +41,7 @@
4141

4242
if (!isActive) {
4343
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
44-
// if mobile we we use a backdrop because click events don't delegate
44+
// if mobile we use a backdrop because click events don't delegate
4545
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
4646
}
4747

@@ -123,9 +123,9 @@
123123
$.fn.dropdown = function (option) {
124124
return this.each(function () {
125125
var $this = $(this)
126-
var data = $this.data('dropdown')
126+
var data = $this.data('bs.dropdown')
127127

128-
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
128+
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
129129
if (typeof option == 'string') data[option].call($this)
130130
})
131131
}

app/assets/javascripts/twitter/bootstrap/modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: modal.js v3.0.2
2+
* Bootstrap: modal.js v3.0.3
33
* http://getbootstrap.com/javascript/#modals
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/popover.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: popover.js v3.0.2
2+
* Bootstrap: popover.js v3.0.3
33
* http://getbootstrap.com/javascript/#popovers
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/scrollspy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: scrollspy.js v3.0.2
2+
* Bootstrap: scrollspy.js v3.0.3
33
* http://getbootstrap.com/javascript/#scrollspy
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.
@@ -113,7 +113,7 @@
113113
.addClass('active')
114114
}
115115

116-
active.trigger('activate')
116+
active.trigger('activate.bs.scrollspy')
117117
}
118118

119119

app/assets/javascripts/twitter/bootstrap/tab.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: tab.js v3.0.2
2+
* Bootstrap: tab.js v3.0.3
33
* http://getbootstrap.com/javascript/#tabs
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/javascripts/twitter/bootstrap/tooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: tooltip.js v3.0.2
2+
* Bootstrap: tooltip.js v3.0.3
33
* http://getbootstrap.com/javascript/#tooltip
44
* Inspired by the original jQuery.tipsy by Jason Frame
55
* ========================================================================

app/assets/javascripts/twitter/bootstrap/transition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: transition.js v3.0.2
2+
* Bootstrap: transition.js v3.0.3
33
* http://getbootstrap.com/javascript/#transitions
44
* ========================================================================
55
* Copyright 2013 Twitter, Inc.

app/assets/stylesheets/twitter/bootstrap/_badges.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
&:empty {
2323
display: none;
2424
}
25+
26+
// Quick fix for badges in buttons
27+
.btn & {
28+
position: relative;
29+
top: -1px;
30+
}
2531
}
2632

2733
// Hover state, but only for links
@@ -34,12 +40,6 @@ a.badge {
3440
}
3541
}
3642

37-
// Quick fix for labels/badges in buttons
38-
.btn .badge {
39-
position: relative;
40-
top: -1px;
41-
}
42-
4343
// Account for counters in navs
4444
a.list-group-item.active > .badge,
4545
.nav-pills > .active > a > .badge {

app/assets/stylesheets/twitter/bootstrap/_button-groups.scss

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,6 @@
22
// Button groups
33
// --------------------------------------------------
44

5-
// Button carets
6-
//
7-
// Match the button text color to the arrow/caret for indicating dropdown-ness.
8-
9-
.caret {
10-
.btn-default & {
11-
border-top-color: $btn-default-color;
12-
}
13-
.btn-primary &,
14-
.btn-success &,
15-
.btn-warning &,
16-
.btn-danger &,
17-
.btn-info & {
18-
border-top-color: #fff;
19-
}
20-
}
21-
.dropup {
22-
.btn-default .caret {
23-
border-bottom-color: $btn-default-color;
24-
}
25-
.btn-primary,
26-
.btn-success,
27-
.btn-warning,
28-
.btn-danger,
29-
.btn-info {
30-
.caret {
31-
border-bottom-color: #fff;
32-
}
33-
}
34-
}
35-
365
// Make the div behave like a button
376
.btn-group,
387
.btn-group-vertical {
@@ -178,7 +147,8 @@
178147

179148
.btn-group-vertical {
180149
> .btn,
181-
> .btn-group {
150+
> .btn-group,
151+
> .btn-group > .btn {
182152
display: block;
183153
float: none;
184154
width: 100%;
@@ -238,11 +208,15 @@
238208
width: 100%;
239209
table-layout: fixed;
240210
border-collapse: separate;
241-
.btn {
211+
> .btn,
212+
> .btn-group {
242213
float: none;
243214
display: table-cell;
244215
width: 1%;
245216
}
217+
> .btn-group .btn {
218+
width: 100%;
219+
}
246220
}
247221

248222

app/assets/stylesheets/twitter/bootstrap/_buttons.scss

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// Base styles
77
// --------------------------------------------------
88

9-
// Core styles
109
.btn {
1110
display: inline-block;
1211
margin-bottom: 0; // For input.btn
@@ -45,7 +44,6 @@
4544
@include opacity(.65);
4645
@include box-shadow(none);
4746
}
48-
4947
}
5048

5149

@@ -123,13 +121,12 @@
123121
// line-height: ensure even-numbered height of button next to large input
124122
@include button-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $line-height-large, $border-radius-large);
125123
}
126-
.btn-sm,
127-
.btn-xs {
124+
.btn-sm {
128125
// line-height: ensure proper height of button next to small input
129126
@include button-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $line-height-small, $border-radius-small);
130127
}
131128
.btn-xs {
132-
padding: 1px 5px;
129+
@include button-size($padding-xs-vertical, $padding-xs-horizontal, $font-size-small, $line-height-small, $border-radius-small);
133130
}
134131

135132

app/assets/stylesheets/twitter/bootstrap/_carousel.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
// Hover/focus state
9292
&:hover,
9393
&:focus {
94+
outline: none;
9495
color: $carousel-control-color;
9596
text-decoration: none;
9697
@include opacity(.9);

app/assets/stylesheets/twitter/bootstrap/_close.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
}
2222
}
2323

24+
2425
// Additional properties for button version
2526
// iOS requires the button element instead of an anchor tag.
2627
// If you want the anchor version, it requires `href="#"`.

app/assets/stylesheets/twitter/bootstrap/_dropdowns.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010
height: 0;
1111
margin-left: 2px;
1212
vertical-align: middle;
13-
border-top: $caret-width-base solid $dropdown-caret-color;
13+
border-top: $caret-width-base solid;
1414
border-right: $caret-width-base solid transparent;
1515
border-left: $caret-width-base solid transparent;
16-
// Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once fixed,
17-
// we can just straight up remove this.
18-
border-bottom: 0 dotted;
1916
}
2017

2118
// The dropdown wrapper (div)
@@ -163,10 +160,8 @@
163160
.navbar-fixed-bottom .dropdown {
164161
// Reverse the caret
165162
.caret {
166-
// Firefox fix for https://github.com/twbs/bootstrap/issues/9538. Once this
167-
// gets fixed, restore `border-top: 0;`.
168-
border-top: 0 dotted;
169-
border-bottom: $caret-width-base solid $dropdown-caret-color;
163+
border-top: 0;
164+
border-bottom: $caret-width-base solid;
170165
content: "";
171166
}
172167
// Different positioning for bottom up menu

0 commit comments

Comments
 (0)