1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-12 08:34:08 +02:00

Merge branch 'twbs/v4-dev' into dropdown-keyboard

This commit is contained in:
Pierre-Denis Vanduynslager
2017-01-06 15:57:15 -05:00
100 changed files with 298 additions and 317 deletions

4
js/dist/alert.js vendored
View File

@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): alert.js
* Bootstrap (v4.0.0-alpha.6): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ var Alert = function ($) {
*/
var NAME = 'alert';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.alert';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

File diff suppressed because one or more lines are too long

8
js/dist/button.js vendored
View File

@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): button.js
* Bootstrap (v4.0.0-alpha.6): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ var Button = function ($) {
*/
var NAME = 'button';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.button';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@@ -87,10 +87,10 @@ var Button = function ($) {
input.focus();
}
} else {
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
}
this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE));
if (triggerChangeEvent) {
$(this._element).toggleClass(ClassName.ACTIVE);
}

File diff suppressed because one or more lines are too long

4
js/dist/carousel.js vendored
View File

@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): carousel.js
* Bootstrap (v4.0.0-alpha.6): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -20,7 +20,7 @@ var Carousel = function ($) {
*/
var NAME = 'carousel';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.carousel';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

File diff suppressed because one or more lines are too long

4
js/dist/collapse.js vendored
View File

@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): collapse.js
* Bootstrap (v4.0.0-alpha.6): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -20,7 +20,7 @@ var Collapse = function ($) {
*/
var NAME = 'collapse';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.collapse';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

File diff suppressed because one or more lines are too long

4
js/dist/dropdown.js vendored
View File

@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): dropdown.js
* Bootstrap (v4.0.0-alpha.6): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ var Dropdown = function ($) {
*/
var NAME = 'dropdown';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.dropdown';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

File diff suppressed because one or more lines are too long

4
js/dist/modal.js vendored
View File

@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): modal.js
* Bootstrap (v4.0.0-alpha.6): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -20,7 +20,7 @@ var Modal = function ($) {
*/
var NAME = 'modal';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.modal';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

File diff suppressed because one or more lines are too long

4
js/dist/popover.js vendored
View File

@@ -10,7 +10,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): popover.js
* Bootstrap (v4.0.0-alpha.6): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -24,7 +24,7 @@ var Popover = function ($) {
*/
var NAME = 'popover';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.popover';
var EVENT_KEY = '.' + DATA_KEY;
var JQUERY_NO_CONFLICT = $.fn[NAME];

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): scrollspy.js
* Bootstrap (v4.0.0-alpha.6): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -20,7 +20,7 @@ var ScrollSpy = function ($) {
*/
var NAME = 'scrollspy';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.scrollspy';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';
@@ -175,7 +175,7 @@ var ScrollSpy = function ($) {
};
ScrollSpy.prototype._getScrollTop = function _getScrollTop() {
return this._scrollElement === window ? this._scrollElement.scrollY : this._scrollElement.scrollTop;
return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
};
ScrollSpy.prototype._getScrollHeight = function _getScrollHeight() {

File diff suppressed because one or more lines are too long

4
js/dist/tab.js vendored
View File

@@ -4,7 +4,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): tab.js
* Bootstrap (v4.0.0-alpha.6): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ var Tab = function ($) {
*/
var NAME = 'tab';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.tab';
var EVENT_KEY = '.' + DATA_KEY;
var DATA_API_KEY = '.data-api';

2
js/dist/tab.js.map vendored

File diff suppressed because one or more lines are too long

4
js/dist/tooltip.js vendored
View File

@@ -6,7 +6,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): tooltip.js
* Bootstrap (v4.0.0-alpha.6): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -28,7 +28,7 @@ var Tooltip = function ($) {
*/
var NAME = 'tooltip';
var VERSION = '4.0.0-alpha.5';
var VERSION = '4.0.0-alpha.6';
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = '.' + DATA_KEY;
var JQUERY_NO_CONFLICT = $.fn[NAME];

File diff suppressed because one or more lines are too long

2
js/dist/util.js vendored
View File

@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): util.js
* Bootstrap (v4.0.0-alpha.6): util.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/

2
js/dist/util.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): alert.js
* Bootstrap (v4.0.0-alpha.6): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Alert = (($) => {
*/
const NAME = 'alert'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.alert'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): button.js
* Bootstrap (v4.0.0-alpha.6): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -15,7 +15,7 @@ const Button = (($) => {
*/
const NAME = 'button'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.button'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -96,11 +96,11 @@ const Button = (($) => {
input.focus()
}
} else {
this._element.setAttribute('aria-pressed',
!$(this._element).hasClass(ClassName.ACTIVE))
}
this._element.setAttribute('aria-pressed',
!$(this._element).hasClass(ClassName.ACTIVE))
if (triggerChangeEvent) {
$(this._element).toggleClass(ClassName.ACTIVE)
}

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): carousel.js
* Bootstrap (v4.0.0-alpha.6): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Carousel = (($) => {
*/
const NAME = 'carousel'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.carousel'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): collapse.js
* Bootstrap (v4.0.0-alpha.6): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Collapse = (($) => {
*/
const NAME = 'collapse'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.collapse'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): dropdown.js
* Bootstrap (v4.0.0-alpha.6): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Dropdown = (($) => {
*/
const NAME = 'dropdown'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.dropdown'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): modal.js
* Bootstrap (v4.0.0-alpha.6): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Modal = (($) => {
*/
const NAME = 'modal'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.modal'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -3,7 +3,7 @@ import Tooltip from './tooltip'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): popover.js
* Bootstrap (v4.0.0-alpha.6): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Popover = (($) => {
*/
const NAME = 'popover'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.popover'
const EVENT_KEY = `.${DATA_KEY}`
const JQUERY_NO_CONFLICT = $.fn[NAME]

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): scrollspy.js
* Bootstrap (v4.0.0-alpha.6): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const ScrollSpy = (($) => {
*/
const NAME = 'scrollspy'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.scrollspy'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -186,7 +186,7 @@ const ScrollSpy = (($) => {
_getScrollTop() {
return this._scrollElement === window ?
this._scrollElement.scrollY : this._scrollElement.scrollTop
this._scrollElement.pageYOffset : this._scrollElement.scrollTop
}
_getScrollHeight() {

View File

@@ -3,7 +3,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): tab.js
* Bootstrap (v4.0.0-alpha.6): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -18,7 +18,7 @@ const Tab = (($) => {
*/
const NAME = 'tab'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.tab'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'

View File

@@ -5,7 +5,7 @@ import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): tooltip.js
* Bootstrap (v4.0.0-alpha.6): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -28,7 +28,7 @@ const Tooltip = (($) => {
*/
const NAME = 'tooltip'
const VERSION = '4.0.0-alpha.5'
const VERSION = '4.0.0-alpha.6'
const DATA_KEY = 'bs.tooltip'
const EVENT_KEY = `.${DATA_KEY}`
const JQUERY_NO_CONFLICT = $.fn[NAME]

View File

@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.0.0-alpha.5): util.js
* Bootstrap (v4.0.0-alpha.6): util.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/

View File

@@ -60,6 +60,17 @@ $(function () {
assert.strictEqual($btn.attr('aria-pressed'), 'true', 'btn aria-pressed state is true')
})
QUnit.test('should toggle aria-pressed on buttons with container', function (assert) {
assert.expect(1)
var groupHTML = '<div class="btn-group" data-toggle="buttons">' +
'<button id="btn1" class="btn btn-secondary" type="button">One</button>' +
'<button class="btn btn-secondary" type="button">Two</button>' +
'</div>'
$('#qunit-fixture').append(groupHTML)
$('#btn1').bootstrapButton('toggle')
assert.strictEqual($('#btn1').attr('aria-pressed'), 'true')
})
QUnit.test('should toggle aria-pressed when btn children are clicked', function (assert) {
assert.expect(2)
var $btn = $('<button class="btn" data-toggle="button" aria-pressed="false">redux</button>')