Skip to content

Commit bf39bb3

Browse files
committed
Rename .active to .show
1 parent ede925d commit bf39bb3

File tree

21 files changed

+121
-121
lines changed

21 files changed

+121
-121
lines changed

docs/components/alerts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ Using the alert JavaScript plugin, it's possible to dismiss any alert inline. He
7373
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
7474
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
7575
- On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the JavaScript functionality. Be sure to use the `<button>` element with it for proper behavior across all devices.
76-
- To animate alerts when dismissing them, be sure to add the `.fade` and `.active` classes.
76+
- To animate alerts when dismissing them, be sure to add the `.fade` and `.show` classes.
7777

7878
You can see this in action with a live demo:
7979

8080
{% example html %}
81-
<div class="alert alert-warning alert-dismissible fade active" role="alert">
81+
<div class="alert alert-warning alert-dismissible fade show" role="alert">
8282
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
8383
<span aria-hidden="true">&times;</span>
8484
</button>
@@ -111,7 +111,7 @@ Note that closing an alert will remove it from the DOM.
111111
| Method | Description |
112112
| --- | --- |
113113
| `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) |
114-
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.in` classes are present on the element, the alert will fade out before it is removed. |
114+
| `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. |
115115

116116
{% highlight js %}$(".alert").alert('close'){% endhighlight %}
117117

docs/components/collapse.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Click the buttons below to show and hide another element via class changes:
1818

1919
- `.collapse` hides content
2020
- `.collapsing` is applied during transitions
21-
- `.collapse.active` shows content
21+
- `.collapse.show` shows content
2222

2323
You can use a link with the `href` attribute, or a button with the `data-target` attribute. In both cases, the `data-toggle="collapse"` is required.
2424

@@ -53,7 +53,7 @@ Extend the default collapse behavior to create an accordion.
5353
</h5>
5454
</div>
5555

56-
<div id="collapseOne" class="collapse active" role="tabpanel" aria-labelledby="headingOne">
56+
<div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
5757
<div class="card-block">
5858
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
5959
</div>
@@ -101,14 +101,14 @@ Additionally, if your control element is targeting a single collapsible element
101101
The collapse plugin utilizes a few classes to handle the heavy lifting:
102102

103103
- `.collapse` hides the content
104-
- `.collapse.active` shows the content
104+
- `.collapse.show` shows the content
105105
- `.collapsing` is added when the transition starts, and removed when it finishes
106106

107107
These classes can be found in `_animation.scss`.
108108

109109
### Via data attributes
110110

111-
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `active`.
111+
Just add `data-toggle="collapse"` and a `data-target` to the element to automatically assign control of a collapsible element. The `data-target` attribute accepts a CSS selector to apply the collapse to. Be sure to add the class `collapse` to the collapsible element. If you'd like it to default open, add the additional class `show`.
112112

113113
To add accordion-like group management to a collapsible control, add the data attribute `data-parent="#selector"`. Refer to the demo to see this in action.
114114

docs/components/dropdowns.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Wrap the dropdown's toggle (your button or link) and the dropdown menu within `.
2121
Any single `.btn` can be turned into a dropdown toggle with some markup changes. Here's how you can put them to work with either `<button>` elements:
2222

2323
{% example html %}
24-
<div class="dropdown active">
24+
<div class="dropdown show">
2525
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
2626
Dropdown button
2727
</button>
@@ -36,7 +36,7 @@ Any single `.btn` can be turned into a dropdown toggle with some markup changes.
3636
And with `<a>` elements:
3737

3838
{% example html %}
39-
<div class="dropdown active">
39+
<div class="dropdown show">
4040
<a class="btn btn-secondary dropdown-toggle" href="https://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4141
Dropdown link
4242
</a>
@@ -407,7 +407,7 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element.
407407
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.
408408

409409
{% example html %}
410-
<div class="dropdown active">
410+
<div class="dropdown show">
411411
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
412412
Dropdown
413413
</button>
@@ -480,7 +480,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**.
480480

481481
## Usage
482482

483-
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.active` class on the parent list item.
483+
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item.
484484

485485
On mobile devices, opening a dropdown adds a `.dropdown-backdrop` as a tap area for closing dropdown menus when tapping outside the menu, a requirement for proper iOS support. **This means that switching from an open dropdown menu to a different dropdown menu requires an extra tap on mobile.**
486486

js/src/alert.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const Alert = (($) => {
3636
}
3737

3838
const ClassName = {
39-
ALERT : 'alert',
40-
FADE : 'fade',
41-
ACTIVE : 'active'
39+
ALERT : 'alert',
40+
FADE : 'fade',
41+
SHOW : 'show'
4242
}
4343

4444

@@ -108,7 +108,7 @@ const Alert = (($) => {
108108
}
109109

110110
_removeElement(element) {
111-
$(element).removeClass(ClassName.ACTIVE)
111+
$(element).removeClass(ClassName.SHOW)
112112

113113
if (!Util.supportsTransitionEnd() ||
114114
!$(element).hasClass(ClassName.FADE)) {

js/src/collapse.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const Collapse = (($) => {
4444
}
4545

4646
const ClassName = {
47-
ACTIVE : 'active',
47+
SHOW : 'show',
4848
COLLAPSE : 'collapse',
4949
COLLAPSING : 'collapsing',
5050
COLLAPSED : 'collapsed'
@@ -56,7 +56,7 @@ const Collapse = (($) => {
5656
}
5757

5858
const Selector = {
59-
ACTIVES : '.card > .active, .card > .collapsing',
59+
ACTIVES : '.card > .show, .card > .collapsing',
6060
DATA_TOGGLE : '[data-toggle="collapse"]'
6161
}
6262

@@ -104,7 +104,7 @@ const Collapse = (($) => {
104104
// public
105105

106106
toggle() {
107-
if ($(this._element).hasClass(ClassName.ACTIVE)) {
107+
if ($(this._element).hasClass(ClassName.SHOW)) {
108108
this.hide()
109109
} else {
110110
this.show()
@@ -116,7 +116,7 @@ const Collapse = (($) => {
116116
throw new Error('Collapse is transitioning')
117117
}
118118

119-
if ($(this._element).hasClass(ClassName.ACTIVE)) {
119+
if ($(this._element).hasClass(ClassName.SHOW)) {
120120
return
121121
}
122122

@@ -171,7 +171,7 @@ const Collapse = (($) => {
171171
$(this._element)
172172
.removeClass(ClassName.COLLAPSING)
173173
.addClass(ClassName.COLLAPSE)
174-
.addClass(ClassName.ACTIVE)
174+
.addClass(ClassName.SHOW)
175175

176176
this._element.style[dimension] = ''
177177

@@ -200,7 +200,7 @@ const Collapse = (($) => {
200200
throw new Error('Collapse is transitioning')
201201
}
202202

203-
if (!$(this._element).hasClass(ClassName.ACTIVE)) {
203+
if (!$(this._element).hasClass(ClassName.SHOW)) {
204204
return
205205
}
206206

@@ -221,7 +221,7 @@ const Collapse = (($) => {
221221
$(this._element)
222222
.addClass(ClassName.COLLAPSING)
223223
.removeClass(ClassName.COLLAPSE)
224-
.removeClass(ClassName.ACTIVE)
224+
.removeClass(ClassName.SHOW)
225225

226226
this._element.setAttribute('aria-expanded', false)
227227

@@ -299,7 +299,7 @@ const Collapse = (($) => {
299299

300300
_addAriaAndCollapsedClass(element, triggerArray) {
301301
if (element) {
302-
const isOpen = $(element).hasClass(ClassName.ACTIVE)
302+
const isOpen = $(element).hasClass(ClassName.SHOW)
303303
element.setAttribute('aria-expanded', isOpen)
304304

305305
if (triggerArray.length) {

js/src/dropdown.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Dropdown = (($) => {
4141
const ClassName = {
4242
BACKDROP : 'dropdown-backdrop',
4343
DISABLED : 'disabled',
44-
ACTIVE : 'active'
44+
SHOW : 'show'
4545
}
4646

4747
const Selector = {
@@ -86,7 +86,7 @@ const Dropdown = (($) => {
8686
}
8787

8888
const parent = Dropdown._getParentFromElement(this)
89-
const isActive = $(parent).hasClass(ClassName.ACTIVE)
89+
const isActive = $(parent).hasClass(ClassName.SHOW)
9090

9191
Dropdown._clearMenus()
9292

@@ -118,7 +118,7 @@ const Dropdown = (($) => {
118118
this.focus()
119119
this.setAttribute('aria-expanded', true)
120120

121-
$(parent).toggleClass(ClassName.ACTIVE)
121+
$(parent).toggleClass(ClassName.SHOW)
122122
$(parent).trigger($.Event(Event.SHOWN, relatedTarget))
123123

124124
return false
@@ -176,7 +176,7 @@ const Dropdown = (($) => {
176176
relatedTarget : toggles[i]
177177
}
178178

179-
if (!$(parent).hasClass(ClassName.ACTIVE)) {
179+
if (!$(parent).hasClass(ClassName.SHOW)) {
180180
continue
181181
}
182182

@@ -195,7 +195,7 @@ const Dropdown = (($) => {
195195
toggles[i].setAttribute('aria-expanded', 'false')
196196

197197
$(parent)
198-
.removeClass(ClassName.ACTIVE)
198+
.removeClass(ClassName.SHOW)
199199
.trigger($.Event(Event.HIDDEN, relatedTarget))
200200
}
201201
}
@@ -225,7 +225,7 @@ const Dropdown = (($) => {
225225
}
226226

227227
const parent = Dropdown._getParentFromElement(this)
228-
const isActive = $(parent).hasClass(ClassName.ACTIVE)
228+
const isActive = $(parent).hasClass(ClassName.SHOW)
229229

230230
if (!isActive && event.which !== ESCAPE_KEYCODE ||
231231
isActive && event.which === ESCAPE_KEYCODE) {

js/src/modal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const Modal = (($) => {
6060
BACKDROP : 'modal-backdrop',
6161
OPEN : 'modal-open',
6262
FADE : 'fade',
63-
ACTIVE : 'active'
63+
SHOW : 'show'
6464
}
6565

6666
const Selector = {
@@ -185,7 +185,7 @@ const Modal = (($) => {
185185

186186
$(document).off(Event.FOCUSIN)
187187

188-
$(this._element).removeClass(ClassName.ACTIVE)
188+
$(this._element).removeClass(ClassName.SHOW)
189189

190190
$(this._element).off(Event.CLICK_DISMISS)
191191
$(this._dialog).off(Event.MOUSEDOWN_DISMISS)
@@ -242,7 +242,7 @@ const Modal = (($) => {
242242
Util.reflow(this._element)
243243
}
244244

245-
$(this._element).addClass(ClassName.ACTIVE)
245+
$(this._element).addClass(ClassName.SHOW)
246246

247247
if (this._config.focus) {
248248
this._enforceFocus()
@@ -356,7 +356,7 @@ const Modal = (($) => {
356356
Util.reflow(this._backdrop)
357357
}
358358

359-
$(this._backdrop).addClass(ClassName.ACTIVE)
359+
$(this._backdrop).addClass(ClassName.SHOW)
360360

361361
if (!callback) {
362362
return
@@ -372,7 +372,7 @@ const Modal = (($) => {
372372
.emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)
373373

374374
} else if (!this._isShown && this._backdrop) {
375-
$(this._backdrop).removeClass(ClassName.ACTIVE)
375+
$(this._backdrop).removeClass(ClassName.SHOW)
376376

377377
const callbackRemove = () => {
378378
this._removeBackdrop()

js/src/popover.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const Popover = (($) => {
3737
})
3838

3939
const ClassName = {
40-
FADE : 'fade',
41-
ACTIVE : 'active'
40+
FADE : 'fade',
41+
SHOW : 'show'
4242
}
4343

4444
const Selector = {
@@ -117,7 +117,7 @@ const Popover = (($) => {
117117
this.setElementContent($tip.find(Selector.TITLE), this.getTitle())
118118
this.setElementContent($tip.find(Selector.CONTENT), this._getContent())
119119

120-
$tip.removeClass(`${ClassName.FADE} ${ClassName.ACTIVE}`)
120+
$tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
121121

122122
this.cleanupTether()
123123
}

0 commit comments

Comments
 (0)