Merge branch 'fix-20982' of https://github.com/Starsam80/bootstrap into Starsam80-fix-20982

This commit is contained in:
Mark Otto 2016-12-19 21:44:03 -08:00
commit 8eeb71c91c
23 changed files with 127 additions and 127 deletions

View File

@ -73,12 +73,12 @@ Using the alert JavaScript plugin, it's possible to dismiss any alert inline. He
- Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript. - Be sure you've loaded the alert plugin, or the compiled Bootstrap JavaScript.
- Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button. - Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button.
- 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. - 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.
- To animate alerts when dismissing them, be sure to add the `.fade` and `.active` classes. - To animate alerts when dismissing them, be sure to add the `.fade` and `.show` classes.
You can see this in action with a live demo: You can see this in action with a live demo:
{% example html %} {% example html %}
<div class="alert alert-warning alert-dismissible fade active" role="alert"> <div class="alert alert-warning alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
@ -111,7 +111,7 @@ Note that closing an alert will remove it from the DOM.
| Method | Description | | Method | Description |
| --- | --- | | --- | --- |
| `$().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.) | | `$().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.) |
| `$().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. | | `$().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. |
{% highlight js %}$(".alert").alert('close'){% endhighlight %} {% highlight js %}$(".alert").alert('close'){% endhighlight %}

View File

@ -18,7 +18,7 @@ Click the buttons below to show and hide another element via class changes:
- `.collapse` hides content - `.collapse` hides content
- `.collapsing` is applied during transitions - `.collapsing` is applied during transitions
- `.collapse.active` shows content - `.collapse.show` shows content
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. 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.
@ -53,7 +53,7 @@ Extend the default collapse behavior to create an accordion.
</h5> </h5>
</div> </div>
<div id="collapseOne" class="collapse active" role="tabpanel" aria-labelledby="headingOne"> <div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block"> <div class="card-block">
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. 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.
</div> </div>
@ -101,14 +101,14 @@ Additionally, if your control element is targeting a single collapsible element
The collapse plugin utilizes a few classes to handle the heavy lifting: The collapse plugin utilizes a few classes to handle the heavy lifting:
- `.collapse` hides the content - `.collapse` hides the content
- `.collapse.active` shows the content - `.collapse.show` shows the content
- `.collapsing` is added when the transition starts, and removed when it finishes - `.collapsing` is added when the transition starts, and removed when it finishes
These classes can be found in `_transitions.scss`. These classes can be found in `_transitions.scss`.
### Via data attributes ### Via data attributes
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`. 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`.
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. 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.

View File

@ -21,7 +21,7 @@ Wrap the dropdown's toggle (your button or link) and the dropdown menu within `.
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: 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:
{% example html %} {% example html %}
<div class="dropdown active"> <div class="dropdown show">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button Dropdown button
</button> </button>
@ -36,7 +36,7 @@ Any single `.btn` can be turned into a dropdown toggle with some markup changes.
And with `<a>` elements: And with `<a>` elements:
{% example html %} {% example html %}
<div class="dropdown active"> <div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="https://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="btn btn-secondary dropdown-toggle" href="https://example.com" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link Dropdown link
</a> </a>
@ -407,7 +407,7 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element.
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. 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.
{% example html %} {% example html %}
<div class="dropdown active"> <div class="dropdown show">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown Dropdown
</button> </button>
@ -480,7 +480,7 @@ Add `.disabled` to items in the dropdown to **style them as disabled**.
## Usage ## Usage
Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.active` class on the parent list item. Via data attributes or JavaScript, the dropdown plugin toggles hidden content (dropdown menus) by toggling the `.show` class on the parent list item.
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.** 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.**

View File

@ -321,7 +321,7 @@ Use the tab JavaScript plugin—include it individually or through the compiled
</li> </li>
</ul> </ul>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledBy="home-tab"> <div role="tabpanel" class="tab-pane fade show active" id="home" aria-labelledBy="home-tab">
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p> <p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</div> </div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab"> <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledBy="profile-tab">
@ -390,11 +390,11 @@ $('#myTab li:eq(2) a').tab('show') // Select third tab (0-indexed)
### Fade effect ### Fade effect
To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.in` to make the initial content visible. To make tabs fade in, add `.fade` to each `.tab-pane`. The first tab pane must also have `.show` to make the initial content visible.
{% highlight html %} {% highlight html %}
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade in active" id="home" role="tabpanel">...</div> <div class="tab-pane fade show active" id="home" role="tabpanel">...</div>
<div class="tab-pane fade" id="profile" role="tabpanel">...</div> <div class="tab-pane fade" id="profile" role="tabpanel">...</div>
<div class="tab-pane fade" id="messages" role="tabpanel">...</div> <div class="tab-pane fade" id="messages" role="tabpanel">...</div>
<div class="tab-pane fade" id="settings" role="tabpanel">...</div> <div class="tab-pane fade" id="settings" role="tabpanel">...</div>

View File

@ -36,9 +36,9 @@ const Alert = (($) => {
} }
const ClassName = { const ClassName = {
ALERT : 'alert', ALERT : 'alert',
FADE : 'fade', FADE : 'fade',
ACTIVE : 'active' SHOW : 'show'
} }
@ -108,7 +108,7 @@ const Alert = (($) => {
} }
_removeElement(element) { _removeElement(element) {
$(element).removeClass(ClassName.ACTIVE) $(element).removeClass(ClassName.SHOW)
if (!Util.supportsTransitionEnd() || if (!Util.supportsTransitionEnd() ||
!$(element).hasClass(ClassName.FADE)) { !$(element).hasClass(ClassName.FADE)) {

View File

@ -44,7 +44,7 @@ const Collapse = (($) => {
} }
const ClassName = { const ClassName = {
ACTIVE : 'active', SHOW : 'show',
COLLAPSE : 'collapse', COLLAPSE : 'collapse',
COLLAPSING : 'collapsing', COLLAPSING : 'collapsing',
COLLAPSED : 'collapsed' COLLAPSED : 'collapsed'
@ -56,7 +56,7 @@ const Collapse = (($) => {
} }
const Selector = { const Selector = {
ACTIVES : '.card > .active, .card > .collapsing', ACTIVES : '.card > .show, .card > .collapsing',
DATA_TOGGLE : '[data-toggle="collapse"]' DATA_TOGGLE : '[data-toggle="collapse"]'
} }
@ -104,7 +104,7 @@ const Collapse = (($) => {
// public // public
toggle() { toggle() {
if ($(this._element).hasClass(ClassName.ACTIVE)) { if ($(this._element).hasClass(ClassName.SHOW)) {
this.hide() this.hide()
} else { } else {
this.show() this.show()
@ -116,7 +116,7 @@ const Collapse = (($) => {
throw new Error('Collapse is transitioning') throw new Error('Collapse is transitioning')
} }
if ($(this._element).hasClass(ClassName.ACTIVE)) { if ($(this._element).hasClass(ClassName.SHOW)) {
return return
} }
@ -171,7 +171,7 @@ const Collapse = (($) => {
$(this._element) $(this._element)
.removeClass(ClassName.COLLAPSING) .removeClass(ClassName.COLLAPSING)
.addClass(ClassName.COLLAPSE) .addClass(ClassName.COLLAPSE)
.addClass(ClassName.ACTIVE) .addClass(ClassName.SHOW)
this._element.style[dimension] = '' this._element.style[dimension] = ''
@ -200,7 +200,7 @@ const Collapse = (($) => {
throw new Error('Collapse is transitioning') throw new Error('Collapse is transitioning')
} }
if (!$(this._element).hasClass(ClassName.ACTIVE)) { if (!$(this._element).hasClass(ClassName.SHOW)) {
return return
} }
@ -221,7 +221,7 @@ const Collapse = (($) => {
$(this._element) $(this._element)
.addClass(ClassName.COLLAPSING) .addClass(ClassName.COLLAPSING)
.removeClass(ClassName.COLLAPSE) .removeClass(ClassName.COLLAPSE)
.removeClass(ClassName.ACTIVE) .removeClass(ClassName.SHOW)
this._element.setAttribute('aria-expanded', false) this._element.setAttribute('aria-expanded', false)
@ -299,7 +299,7 @@ const Collapse = (($) => {
_addAriaAndCollapsedClass(element, triggerArray) { _addAriaAndCollapsedClass(element, triggerArray) {
if (element) { if (element) {
const isOpen = $(element).hasClass(ClassName.ACTIVE) const isOpen = $(element).hasClass(ClassName.SHOW)
element.setAttribute('aria-expanded', isOpen) element.setAttribute('aria-expanded', isOpen)
if (triggerArray.length) { if (triggerArray.length) {

View File

@ -41,7 +41,7 @@ const Dropdown = (($) => {
const ClassName = { const ClassName = {
BACKDROP : 'dropdown-backdrop', BACKDROP : 'dropdown-backdrop',
DISABLED : 'disabled', DISABLED : 'disabled',
ACTIVE : 'active' SHOW : 'show'
} }
const Selector = { const Selector = {
@ -86,7 +86,7 @@ const Dropdown = (($) => {
} }
const parent = Dropdown._getParentFromElement(this) const parent = Dropdown._getParentFromElement(this)
const isActive = $(parent).hasClass(ClassName.ACTIVE) const isActive = $(parent).hasClass(ClassName.SHOW)
Dropdown._clearMenus() Dropdown._clearMenus()
@ -118,7 +118,7 @@ const Dropdown = (($) => {
this.focus() this.focus()
this.setAttribute('aria-expanded', true) this.setAttribute('aria-expanded', true)
$(parent).toggleClass(ClassName.ACTIVE) $(parent).toggleClass(ClassName.SHOW)
$(parent).trigger($.Event(Event.SHOWN, relatedTarget)) $(parent).trigger($.Event(Event.SHOWN, relatedTarget))
return false return false
@ -176,7 +176,7 @@ const Dropdown = (($) => {
relatedTarget : toggles[i] relatedTarget : toggles[i]
} }
if (!$(parent).hasClass(ClassName.ACTIVE)) { if (!$(parent).hasClass(ClassName.SHOW)) {
continue continue
} }
@ -195,7 +195,7 @@ const Dropdown = (($) => {
toggles[i].setAttribute('aria-expanded', 'false') toggles[i].setAttribute('aria-expanded', 'false')
$(parent) $(parent)
.removeClass(ClassName.ACTIVE) .removeClass(ClassName.SHOW)
.trigger($.Event(Event.HIDDEN, relatedTarget)) .trigger($.Event(Event.HIDDEN, relatedTarget))
} }
} }
@ -225,7 +225,7 @@ const Dropdown = (($) => {
} }
const parent = Dropdown._getParentFromElement(this) const parent = Dropdown._getParentFromElement(this)
const isActive = $(parent).hasClass(ClassName.ACTIVE) const isActive = $(parent).hasClass(ClassName.SHOW)
if (!isActive && event.which !== ESCAPE_KEYCODE || if (!isActive && event.which !== ESCAPE_KEYCODE ||
isActive && event.which === ESCAPE_KEYCODE) { isActive && event.which === ESCAPE_KEYCODE) {

View File

@ -60,7 +60,7 @@ const Modal = (($) => {
BACKDROP : 'modal-backdrop', BACKDROP : 'modal-backdrop',
OPEN : 'modal-open', OPEN : 'modal-open',
FADE : 'fade', FADE : 'fade',
ACTIVE : 'active' SHOW : 'show'
} }
const Selector = { const Selector = {
@ -185,7 +185,7 @@ const Modal = (($) => {
$(document).off(Event.FOCUSIN) $(document).off(Event.FOCUSIN)
$(this._element).removeClass(ClassName.ACTIVE) $(this._element).removeClass(ClassName.SHOW)
$(this._element).off(Event.CLICK_DISMISS) $(this._element).off(Event.CLICK_DISMISS)
$(this._dialog).off(Event.MOUSEDOWN_DISMISS) $(this._dialog).off(Event.MOUSEDOWN_DISMISS)
@ -242,7 +242,7 @@ const Modal = (($) => {
Util.reflow(this._element) Util.reflow(this._element)
} }
$(this._element).addClass(ClassName.ACTIVE) $(this._element).addClass(ClassName.SHOW)
if (this._config.focus) { if (this._config.focus) {
this._enforceFocus() this._enforceFocus()
@ -356,7 +356,7 @@ const Modal = (($) => {
Util.reflow(this._backdrop) Util.reflow(this._backdrop)
} }
$(this._backdrop).addClass(ClassName.ACTIVE) $(this._backdrop).addClass(ClassName.SHOW)
if (!callback) { if (!callback) {
return return
@ -372,7 +372,7 @@ const Modal = (($) => {
.emulateTransitionEnd(BACKDROP_TRANSITION_DURATION) .emulateTransitionEnd(BACKDROP_TRANSITION_DURATION)
} else if (!this._isShown && this._backdrop) { } else if (!this._isShown && this._backdrop) {
$(this._backdrop).removeClass(ClassName.ACTIVE) $(this._backdrop).removeClass(ClassName.SHOW)
const callbackRemove = () => { const callbackRemove = () => {
this._removeBackdrop() this._removeBackdrop()

View File

@ -37,8 +37,8 @@ const Popover = (($) => {
}) })
const ClassName = { const ClassName = {
FADE : 'fade', FADE : 'fade',
ACTIVE : 'active' SHOW : 'show'
} }
const Selector = { const Selector = {
@ -117,7 +117,7 @@ const Popover = (($) => {
this.setElementContent($tip.find(Selector.TITLE), this.getTitle()) this.setElementContent($tip.find(Selector.TITLE), this.getTitle())
this.setElementContent($tip.find(Selector.CONTENT), this._getContent()) this.setElementContent($tip.find(Selector.CONTENT), this._getContent())
$tip.removeClass(`${ClassName.FADE} ${ClassName.ACTIVE}`) $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
this.cleanupTether() this.cleanupTether()
} }

View File

@ -37,7 +37,7 @@ const Tab = (($) => {
DROPDOWN_MENU : 'dropdown-menu', DROPDOWN_MENU : 'dropdown-menu',
ACTIVE : 'active', ACTIVE : 'active',
FADE : 'fade', FADE : 'fade',
IN : 'in' SHOW : 'show'
} }
const Selector = { const Selector = {
@ -173,7 +173,7 @@ const Tab = (($) => {
} }
if (active) { if (active) {
$(active).removeClass(ClassName.IN) $(active).removeClass(ClassName.SHOW)
} }
} }
@ -197,7 +197,7 @@ const Tab = (($) => {
if (isTransitioning) { if (isTransitioning) {
Util.reflow(element) Util.reflow(element)
$(element).addClass(ClassName.IN) $(element).addClass(ClassName.SHOW)
} else { } else {
$(element).removeClass(ClassName.FADE) $(element).removeClass(ClassName.FADE)
} }

View File

@ -72,8 +72,8 @@ const Tooltip = (($) => {
} }
const HoverState = { const HoverState = {
ACTIVE : 'active', SHOW : 'show',
OUT : 'out' OUT : 'out'
} }
const Event = { const Event = {
@ -90,8 +90,8 @@ const Tooltip = (($) => {
} }
const ClassName = { const ClassName = {
FADE : 'fade', FADE : 'fade',
ACTIVE : 'active' SHOW : 'show'
} }
const Selector = { const Selector = {
@ -208,7 +208,7 @@ const Tooltip = (($) => {
} else { } else {
if ($(this.getTipElement()).hasClass(ClassName.ACTIVE)) { if ($(this.getTipElement()).hasClass(ClassName.SHOW)) {
this._leave(null, this) this._leave(null, this)
return return
} }
@ -303,7 +303,7 @@ const Tooltip = (($) => {
Util.reflow(tip) Util.reflow(tip)
this._tether.position() this._tether.position()
$(tip).addClass(ClassName.ACTIVE) $(tip).addClass(ClassName.SHOW)
const complete = () => { const complete = () => {
const prevHoverState = this._hoverState const prevHoverState = this._hoverState
@ -336,7 +336,7 @@ const Tooltip = (($) => {
throw new Error('Tooltip is transitioning') throw new Error('Tooltip is transitioning')
} }
const complete = () => { const complete = () => {
if (this._hoverState !== HoverState.ACTIVE && tip.parentNode) { if (this._hoverState !== HoverState.SHOW && tip.parentNode) {
tip.parentNode.removeChild(tip) tip.parentNode.removeChild(tip)
} }
@ -356,7 +356,7 @@ const Tooltip = (($) => {
return return
} }
$(tip).removeClass(ClassName.ACTIVE) $(tip).removeClass(ClassName.SHOW)
if (Util.supportsTransitionEnd() && if (Util.supportsTransitionEnd() &&
$(this.tip).hasClass(ClassName.FADE)) { $(this.tip).hasClass(ClassName.FADE)) {
@ -388,7 +388,7 @@ const Tooltip = (($) => {
this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle()) this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle())
$tip.removeClass(`${ClassName.FADE} ${ClassName.ACTIVE}`) $tip.removeClass(`${ClassName.FADE} ${ClassName.SHOW}`)
this.cleanupTether() this.cleanupTether()
} }
@ -513,15 +513,15 @@ const Tooltip = (($) => {
] = true ] = true
} }
if ($(context.getTipElement()).hasClass(ClassName.ACTIVE) || if ($(context.getTipElement()).hasClass(ClassName.SHOW) ||
context._hoverState === HoverState.ACTIVE) { context._hoverState === HoverState.SHOW) {
context._hoverState = HoverState.ACTIVE context._hoverState = HoverState.SHOW
return return
} }
clearTimeout(context._timeout) clearTimeout(context._timeout)
context._hoverState = HoverState.ACTIVE context._hoverState = HoverState.SHOW
if (!context.config.delay || !context.config.delay.show) { if (!context.config.delay || !context.config.delay.show) {
context.show() context.show()
@ -529,7 +529,7 @@ const Tooltip = (($) => {
} }
context._timeout = setTimeout(() => { context._timeout = setTimeout(() => {
if (context._hoverState === HoverState.ACTIVE) { if (context._hoverState === HoverState.SHOW) {
context.show() context.show()
} }
}, context.config.delay.show) }, context.config.delay.show)

View File

@ -34,7 +34,7 @@ $(function () {
QUnit.test('should fade element out on clicking .close', function (assert) { QUnit.test('should fade element out on clicking .close', function (assert) {
assert.expect(1) assert.expect(1)
var alertHTML = '<div class="alert alert-danger fade active">' var alertHTML = '<div class="alert alert-danger fade show">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>' + '<a class="close" href="#" data-dismiss="alert">×</a>'
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>' + '</div>'
@ -43,12 +43,12 @@ $(function () {
$alert.find('.close').trigger('click') $alert.find('.close').trigger('click')
assert.strictEqual($alert.hasClass('active'), false, 'remove .active class on .close click') assert.strictEqual($alert.hasClass('show'), false, 'remove .show class on .close click')
}) })
QUnit.test('should remove element when clicking .close', function (assert) { QUnit.test('should remove element when clicking .close', function (assert) {
assert.expect(2) assert.expect(2)
var alertHTML = '<div class="alert alert-danger fade active">' var alertHTML = '<div class="alert alert-danger fade show">'
+ '<a class="close" href="#" data-dismiss="alert">×</a>' + '<a class="close" href="#" data-dismiss="alert">×</a>'
+ '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>' + '<p><strong>Holy guacamole!</strong> Best check yo self, you\'re not looking too good.</p>'
+ '</div>' + '</div>'

View File

@ -48,7 +48,7 @@ $(function () {
assert.expect(2) assert.expect(2)
var $el = $('<div class="collapse"/>').bootstrapCollapse('show') var $el = $('<div class="collapse"/>').bootstrapCollapse('show')
assert.ok($el.hasClass('active'), 'has class "active"') assert.ok($el.hasClass('show'), 'has class "show"')
assert.ok(!/height/i.test($el.attr('style')), 'has height reset') assert.ok(!/height/i.test($el.attr('style')), 'has height reset')
}) })
@ -62,7 +62,7 @@ $(function () {
'</div>', '</div>',
'<div class="panel-group" id="accordion2">', '<div class="panel-group" id="accordion2">',
'<div class="panel">', '<div class="panel">',
'<div id="collapse2" class="collapse active"/>', '<div id="collapse2" class="collapse show"/>',
'</div>', '</div>',
'</div>' '</div>'
].join('') ].join('')
@ -71,15 +71,15 @@ $(function () {
var $el2 = $('#collapse2') var $el2 = $('#collapse2')
$el1.bootstrapCollapse('show') $el1.bootstrapCollapse('show')
assert.ok($el1.hasClass('active')) assert.ok($el1.hasClass('show'))
assert.ok($el2.hasClass('active')) assert.ok($el2.hasClass('show'))
}) })
QUnit.test('should hide a collapsed element', function (assert) { QUnit.test('should hide a collapsed element', function (assert) {
assert.expect(1) assert.expect(1)
var $el = $('<div class="collapse"/>').bootstrapCollapse('hide') var $el = $('<div class="collapse"/>').bootstrapCollapse('hide')
assert.ok(!$el.hasClass('active'), 'does not have class "active"') assert.ok(!$el.hasClass('show'), 'does not have class "show"')
}) })
QUnit.test('should not fire shown when show is prevented', function (assert) { QUnit.test('should not fire shown when show is prevented', function (assert) {
@ -150,7 +150,7 @@ $(function () {
var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="active"/>') $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hidden.bs.collapse', function () { .on('hidden.bs.collapse', function () {
assert.ok($target.hasClass('collapsed'), 'target has collapsed class') assert.ok($target.hasClass('collapsed'), 'target has collapsed class')
@ -185,7 +185,7 @@ $(function () {
var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
var $alt = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="active"/>') $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hidden.bs.collapse', function () { .on('hidden.bs.collapse', function () {
assert.ok($target.hasClass('collapsed'), 'target has collapsed class') assert.ok($target.hasClass('collapsed'), 'target has collapsed class')
@ -200,7 +200,7 @@ $(function () {
assert.expect(0) assert.expect(0)
var done = assert.async() var done = assert.async()
var $test = $('<div id="test1" class="active"/>') var $test = $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hide.bs.collapse', function () { .on('hide.bs.collapse', function () {
assert.ok(false) assert.ok(false)
@ -244,7 +244,7 @@ $(function () {
assert.expect(1) assert.expect(1)
var done = assert.async() var done = assert.async()
$('<div class="collapse active"></div>') $('<div class="collapse show"></div>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hide.bs.collapse', function () { .on('hide.bs.collapse', function () {
assert.ok(true, 'hiding a previously-uninitialized shown collapse when the "hide" method is called') assert.ok(true, 'hiding a previously-uninitialized shown collapse when the "hide" method is called')
@ -267,7 +267,7 @@ $(function () {
var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" class="active"/>').appendTo($groups.eq(0)) $('<div id="body1" class="show"/>').appendTo($groups.eq(0))
var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent="#accordion"/>').appendTo($groups.eq(1))
@ -301,7 +301,7 @@ $(function () {
var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent=".accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" class="active"/>').appendTo($groups.eq(0)) $('<div id="body1" class="show"/>').appendTo($groups.eq(0))
var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent=".accordion"/>').appendTo($groups.eq(1)) var $target2 = $('<a class="collapsed" data-toggle="collapse" role="button" href="#body2" data-parent=".accordion"/>').appendTo($groups.eq(1))
@ -344,7 +344,7 @@ $(function () {
var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="active"/>') $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hidden.bs.collapse', function () { .on('hidden.bs.collapse', function () {
assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"') assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"')
@ -379,7 +379,7 @@ $(function () {
var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
var $alt = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture') var $alt = $('<a role="button" data-toggle="collapse" href="#test1" aria-expanded="true"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="active"/>') $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hidden.bs.collapse', function () { .on('hidden.bs.collapse', function () {
assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"') assert.strictEqual($target.attr('aria-expanded'), 'false', 'aria-expanded on target is "false"')
@ -403,7 +403,7 @@ $(function () {
var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0)) var $target1 = $('<a role="button" data-toggle="collapse" href="#body1" data-parent="#accordion"/>').appendTo($groups.eq(0))
$('<div id="body1" aria-expanded="true" class="active"/>').appendTo($groups.eq(0)) $('<div id="body1" aria-expanded="true" class="show"/>').appendTo($groups.eq(0))
var $target2 = $('<a role="button" data-toggle="collapse" href="#body2" data-parent="#accordion" class="collapsed" />').appendTo($groups.eq(1)) var $target2 = $('<a role="button" data-toggle="collapse" href="#body2" data-parent="#accordion" class="collapsed" />').appendTo($groups.eq(1))
@ -449,7 +449,7 @@ $(function () {
$target2.trigger('click') $target2.trigger('click')
$body2 $body2
.toggleClass('active collapsing') .toggleClass('show collapsing')
.data('bs.collapse')._isTransitioning = 1 .data('bs.collapse')._isTransitioning = 1
$target1.trigger('click') $target1.trigger('click')
@ -466,7 +466,7 @@ $(function () {
var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture') var $target = $('<a role="button" data-toggle="collapse" href="#test1"/>').appendTo('#qunit-fixture')
$('<div id="test1" class="active"/>') $('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture') .appendTo('#qunit-fixture')
.on('hidden.bs.collapse', function () { .on('hidden.bs.collapse', function () {
assert.ok($target.hasClass('collapsed')) assert.ok($target.hasClass('collapsed'))

View File

@ -59,7 +59,7 @@ $(function () {
+ '</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click') var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
}) })
QUnit.test('should set aria-expanded="true" on target when dropdown menu is shown', function (assert) { QUnit.test('should set aria-expanded="true" on target when dropdown menu is shown', function (assert) {
@ -128,10 +128,10 @@ $(function () {
+ '</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click') var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
}) })
QUnit.test('should add class active to menu if clicked', function (assert) { QUnit.test('should add class show to menu if clicked', function (assert) {
assert.expect(1) assert.expect(1)
var dropdownHTML = '<ul class="tabs">' var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">' + '<li class="dropdown">'
@ -146,7 +146,7 @@ $(function () {
+ '</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click') var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click') assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
}) })
QUnit.test('should test if element has a # before assuming it\'s a selector', function (assert) { QUnit.test('should test if element has a # before assuming it\'s a selector', function (assert) {
@ -164,11 +164,11 @@ $(function () {
+ '</ul>' + '</ul>'
var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click') var $dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').bootstrapDropdown().trigger('click')
assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click') assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
}) })
QUnit.test('should remove "active" class if body is clicked', function (assert) { QUnit.test('should remove "show" class if body is clicked', function (assert) {
assert.expect(2) assert.expect(2)
var dropdownHTML = '<ul class="tabs">' var dropdownHTML = '<ul class="tabs">'
+ '<li class="dropdown">' + '<li class="dropdown">'
@ -187,12 +187,12 @@ $(function () {
.bootstrapDropdown() .bootstrapDropdown()
.trigger('click') .trigger('click')
assert.ok($dropdown.parent('.dropdown').hasClass('active'), '"active" class added on click') assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
$(document.body).trigger('click') $(document.body).trigger('click')
assert.ok(!$dropdown.parent('.dropdown').hasClass('active'), '"active" class removed') assert.ok(!$dropdown.parent('.dropdown').hasClass('show'), '"show" class removed')
}) })
QUnit.test('should remove "active" class if body is clicked, with multiple dropdowns', function (assert) { QUnit.test('should remove "show" class if body is clicked, with multiple dropdowns', function (assert) {
assert.expect(7) assert.expect(7)
var dropdownHTML = '<ul class="nav">' var dropdownHTML = '<ul class="nav">'
+ '<li><a href="#menu1">Menu 1</a></li>' + '<li><a href="#menu1">Menu 1</a></li>'
@ -217,16 +217,16 @@ $(function () {
assert.strictEqual($dropdowns.length, 2, 'two dropdowns') assert.strictEqual($dropdowns.length, 2, 'two dropdowns')
$first.trigger('click') $first.trigger('click')
assert.strictEqual($first.parents('.active').length, 1, '"active" class added on click') assert.strictEqual($first.parents('.show').length, 1, '"show" class added on click')
assert.strictEqual($('#qunit-fixture .active').length, 1, 'only one dropdown is active') assert.strictEqual($('#qunit-fixture .show').length, 1, 'only one dropdown is shown')
$(document.body).trigger('click') $(document.body).trigger('click')
assert.strictEqual($('#qunit-fixture .active').length, 0, '"active" class removed') assert.strictEqual($('#qunit-fixture .show').length, 0, '"show" class removed')
$last.trigger('click') $last.trigger('click')
assert.strictEqual($last.parent('.active').length, 1, '"active" class added on click') assert.strictEqual($last.parent('.show').length, 1, '"show" class added on click')
assert.strictEqual($('#qunit-fixture .active').length, 1, 'only one dropdown is active') assert.strictEqual($('#qunit-fixture .show').length, 1, 'only one dropdown is shown')
$(document.body).trigger('click') $(document.body).trigger('click')
assert.strictEqual($('#qunit-fixture .active').length, 0, '"active" class removed') assert.strictEqual($('#qunit-fixture .show').length, 0, '"show" class removed')
}) })
QUnit.test('should fire show and hide event', function (assert) { QUnit.test('should fire show and hide event', function (assert) {
@ -411,7 +411,7 @@ $(function () {
$('#textField').trigger('click') $('#textField').trigger('click')
assert.ok($dropdown.parent('.btn-group').hasClass('active'), 'dropdown menu is active') assert.ok($dropdown.parent('.btn-group').hasClass('show'), 'dropdown menu is shown')
}) })
QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) { QUnit.test('should not close the dropdown if the user clicks on a textarea', function (assert) {
@ -430,6 +430,6 @@ $(function () {
$('#textArea').trigger('click') $('#textArea').trigger('click')
assert.ok($dropdown.parent('.btn-group').hasClass('active'), 'dropdown menu is active') assert.ok($dropdown.parent('.btn-group').hasClass('show'), 'dropdown menu is shown')
}) })
}) })

View File

@ -229,7 +229,7 @@ $(function () {
$popover.bootstrapPopover('show') $popover.bootstrapPopover('show')
$popover.bootstrapPopover('dispose') $popover.bootstrapPopover('dispose')
assert.ok(!$popover.hasClass('active'), 'popover is hidden') assert.ok(!$popover.hasClass('show'), 'popover is hidden')
assert.ok(!$popover.data('popover'), 'popover does not have data') assert.ok(!$popover.data('popover'), 'popover does not have data')
assert.strictEqual($._data($popover[0], 'events').click[0].namespace, 'foo', 'popover still has click.foo') assert.strictEqual($._data($popover[0], 'events').click[0].namespace, 'foo', 'popover still has click.foo')
assert.ok(!$._data($popover[0], 'events').mouseover && !$._data($popover[0], 'events').mouseout, 'popover does not have any events') assert.ok(!$._data($popover[0], 'events').mouseover && !$._data($popover[0], 'events').mouseout, 'popover does not have any events')

View File

@ -111,7 +111,7 @@ $(function () {
assert assert
.ok($('.tooltip') .ok($('.tooltip')
.is('.fade.bs-tether-element-attached-top.bs-tether-element-attached-center.active'), 'has correct classes applied') .is('.fade.bs-tether-element-attached-top.bs-tether-element-attached-center.show'), 'has correct classes applied')
$tooltip.bootstrapTooltip('hide') $tooltip.bootstrapTooltip('hide')
@ -306,7 +306,7 @@ $(function () {
$tooltip.bootstrapTooltip('show') $tooltip.bootstrapTooltip('show')
$tooltip.bootstrapTooltip('dispose') $tooltip.bootstrapTooltip('dispose')
assert.ok(!$tooltip.hasClass('active'), 'tooltip is hidden') assert.ok(!$tooltip.hasClass('show'), 'tooltip is hidden')
assert.ok(!$._data($tooltip[0], 'bs.tooltip'), 'tooltip does not have data') assert.ok(!$._data($tooltip[0], 'bs.tooltip'), 'tooltip does not have data')
assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip still has click.foo') assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip still has click.foo')
assert.ok(!$._data($tooltip[0], 'events').mouseover && !$._data($tooltip[0], 'events').mouseout, 'tooltip does not have hover events') assert.ok(!$._data($tooltip[0], 'events').mouseover && !$._data($tooltip[0], 'events').mouseout, 'tooltip does not have hover events')
@ -335,7 +335,7 @@ $(function () {
.bootstrapTooltip({ trigger: 'manual' }) .bootstrapTooltip({ trigger: 'manual' })
.bootstrapTooltip('toggle') .bootstrapTooltip('toggle')
assert.ok($('.tooltip').is('.fade.active'), 'tooltip is faded active') assert.ok($('.tooltip').is('.fade.show'), 'tooltip is faded active')
}) })
QUnit.test('should hide previously shown tooltip when toggle is called on tooltip', function (assert) { QUnit.test('should hide previously shown tooltip when toggle is called on tooltip', function (assert) {
@ -346,7 +346,7 @@ $(function () {
.bootstrapTooltip('show') .bootstrapTooltip('show')
$('.tooltip').bootstrapTooltip('toggle') $('.tooltip').bootstrapTooltip('toggle')
assert.ok($('.tooltip').not('.fade.active'), 'tooltip was faded out') assert.ok($('.tooltip').not('.fade.show'), 'tooltip was faded out')
}) })
QUnit.test('should place tooltips inside body when container is body', function (assert) { QUnit.test('should place tooltips inside body when container is body', function (assert) {
@ -502,11 +502,11 @@ $(function () {
.bootstrapTooltip({ delay: 150 }) .bootstrapTooltip({ delay: 150 })
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip is not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip is not faded active')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok($('.tooltip').is('.fade.active'), '200ms: tooltip is faded active') assert.ok($('.tooltip').is('.fade.show'), '200ms: tooltip is faded active')
done() done()
}, 200) }, 200)
@ -522,12 +522,12 @@ $(function () {
.bootstrapTooltip({ delay: 150 }) .bootstrapTooltip({ delay: 150 })
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active')
$tooltip.trigger('mouseout') $tooltip.trigger('mouseout')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '200ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '200ms: tooltip not faded active')
done() done()
}, 200) }, 200)
@ -543,16 +543,16 @@ $(function () {
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) .bootstrapTooltip({ delay: { show: 0, hide: 150 } })
setTimeout(function () { setTimeout(function () {
assert.ok($('.tooltip').is('.fade.active'), '1ms: tooltip faded active') assert.ok($('.tooltip').is('.fade.show'), '1ms: tooltip faded active')
$tooltip.trigger('mouseout') $tooltip.trigger('mouseout')
setTimeout(function () { setTimeout(function () {
assert.ok($('.tooltip').is('.fade.active'), '100ms: tooltip still faded active') assert.ok($('.tooltip').is('.fade.show'), '100ms: tooltip still faded active')
$tooltip.trigger('mouseenter') $tooltip.trigger('mouseenter')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok($('.tooltip').is('.fade.active'), '200ms: tooltip still faded active') assert.ok($('.tooltip').is('.fade.show'), '200ms: tooltip still faded active')
done() done()
}, 200) }, 200)
}, 0) }, 0)
@ -569,12 +569,12 @@ $(function () {
.bootstrapTooltip({ delay: 150 }) .bootstrapTooltip({ delay: 150 })
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active')
$tooltip.trigger('mouseout') $tooltip.trigger('mouseout')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '200ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '200ms: tooltip not faded active')
done() done()
}, 200) }, 200)
@ -590,12 +590,12 @@ $(function () {
.bootstrapTooltip({ delay: { show: 150, hide: 0 } }) .bootstrapTooltip({ delay: { show: 150, hide: 0 } })
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '100ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '100ms: tooltip not faded active')
$tooltip.trigger('mouseout') $tooltip.trigger('mouseout')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok(!$('.tooltip').is('.fade.active'), '250ms: tooltip not faded active') assert.ok(!$('.tooltip').is('.fade.show'), '250ms: tooltip not faded active')
done() done()
}, 250) }, 250)
@ -611,16 +611,16 @@ $(function () {
.bootstrapTooltip({ delay: { show: 0, hide: 150 } }) .bootstrapTooltip({ delay: { show: 0, hide: 150 } })
setTimeout(function () { setTimeout(function () {
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.active'), '1ms: tooltip faded active') assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.show'), '1ms: tooltip faded active')
$tooltip.trigger('mouseout') $tooltip.trigger('mouseout')
setTimeout(function () { setTimeout(function () {
assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.active'), '100ms: tooltip still faded active') assert.ok($($tooltip.data('bs.tooltip').tip).is('.fade.show'), '100ms: tooltip still faded active')
}, 100) }, 100)
setTimeout(function () { setTimeout(function () {
assert.ok(!$($tooltip.data('bs.tooltip').tip).is('.active'), '200ms: tooltip removed') assert.ok(!$($tooltip.data('bs.tooltip').tip).is('.show'), '200ms: tooltip removed')
done() done()
}, 200) }, 200)
@ -726,7 +726,7 @@ $(function () {
assert.ok(obj._hoverState === 'out', 'the tooltip hoverState should be set to "out"') assert.ok(obj._hoverState === 'out', 'the tooltip hoverState should be set to "out"')
$('#tt-outer').trigger('mouseenter') $('#tt-outer').trigger('mouseenter')
assert.ok(obj._hoverState === 'active', 'the tooltip hoverState should be set to "active"') assert.ok(obj._hoverState === 'show', 'the tooltip hoverState should be set to "show"')
assert.strictEqual(currentUid, $('#tt-content').text()) assert.strictEqual(currentUid, $('#tt-content').text())
}) })
@ -788,7 +788,7 @@ $(function () {
var tooltip = $el.data('bs.tooltip') var tooltip = $el.data('bs.tooltip')
var $tooltip = $(tooltip.getTipElement()) var $tooltip = $(tooltip.getTipElement())
function showingTooltip() { return $tooltip.hasClass('active') || tooltip._hoverState === 'active' } function showingTooltip() { return $tooltip.hasClass('show') || tooltip._hoverState === 'show' }
var tests = [ var tests = [
['mouseenter', 'mouseleave'], ['mouseenter', 'mouseleave'],

View File

@ -11,14 +11,14 @@
<div class="container"> <div class="container">
<h1>Alert <small>Bootstrap Visual Test</small></h1> <h1>Alert <small>Bootstrap Visual Test</small></h1>
<div class="alert alert-warning alert-dismissible fade active" role="alert"> <div class="alert alert-warning alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
<strong>Holy guacamole!</strong> You should check in on some of those fields below. <strong>Holy guacamole!</strong> You should check in on some of those fields below.
</div> </div>
<div class="alert alert-danger alert-dismissible fade active" role="alert"> <div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
@ -31,7 +31,7 @@
</p> </p>
</div> </div>
<div class="alert alert-danger alert-dismissible fade active" role="alert"> <div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"> <button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>

View File

@ -21,7 +21,7 @@
</h5> </h5>
</div> </div>
<div id="collapseOne" class="collapse active" role="tabpanel" aria-labelledby="headingOne"> <div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block"> <div class="card-block">
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. 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.
</div> </div>

View File

@ -65,7 +65,7 @@
</h5> </h5>
</div> </div>
<div id="collapseOne" class="collapse active" role="tabpanel" aria-labelledby="headingOne"> <div id="collapseOne" class="collapse show" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block"> <div class="card-block">
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. 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.
</div> </div>

View File

@ -111,7 +111,7 @@
} }
// Open state for the dropdown // Open state for the dropdown
.active { .show {
// Show the menu // Show the menu
> .dropdown-menu { > .dropdown-menu {
display: block; display: block;

View File

@ -31,7 +31,7 @@
@include transition($modal-transition); @include transition($modal-transition);
transform: translate(0, -25%); transform: translate(0, -25%);
} }
&.active .modal-dialog { transform: translate(0, 0); } &.show .modal-dialog { transform: translate(0, 0); }
} }
.modal-open .modal { .modal-open .modal {
overflow-x: hidden; overflow-x: hidden;
@ -69,7 +69,7 @@
// Fade for backdrop // Fade for backdrop
&.fade { opacity: 0; } &.fade { opacity: 0; }
&.active { opacity: $modal-backdrop-opacity; } &.show { opacity: $modal-backdrop-opacity; }
} }
// Modal header // Modal header

View File

@ -11,7 +11,7 @@
word-wrap: break-word; word-wrap: break-word;
opacity: 0; opacity: 0;
&.active { opacity: $tooltip-opacity; } &.show { opacity: $tooltip-opacity; }
&.tooltip-top, &.tooltip-top,
&.bs-tether-element-attached-bottom { &.bs-tether-element-attached-bottom {

View File

@ -2,26 +2,26 @@
opacity: 0; opacity: 0;
@include transition($transition-fade); @include transition($transition-fade);
&.active { &.show {
opacity: 1; opacity: 1;
} }
} }
.collapse { .collapse {
display: none; display: none;
&.active { &.show {
display: block; display: block;
} }
} }
tr { tr {
&.collapse.active { &.collapse.show {
display: table-row; display: table-row;
} }
} }
tbody { tbody {
&.collapse.active { &.collapse.show {
display: table-row-group; display: table-row-group;
} }
} }