1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-21 12:51:52 +02:00
This commit is contained in:
Mark Otto
2016-11-25 15:00:23 -08:00
parent 432fe74c31
commit 49be9bc63a
38 changed files with 177 additions and 89 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

13
js/dist/dropdown.js vendored
View File

@@ -96,7 +96,9 @@ var Dropdown = function ($) {
$(dropdown).on('click', Dropdown._clearMenus);
}
var relatedTarget = { relatedTarget: this };
var relatedTarget = {
relatedTarget: this
};
var showEvent = $.Event(Event.SHOW, relatedTarget);
$(parent).trigger(showEvent);
@@ -106,7 +108,7 @@ var Dropdown = function ($) {
}
this.focus();
this.setAttribute('aria-expanded', 'true');
this.setAttribute('aria-expanded', true);
$(parent).toggleClass(ClassName.ACTIVE);
$(parent).trigger($.Event(Event.SHOWN, relatedTarget));
@@ -133,7 +135,8 @@ var Dropdown = function ($) {
var data = $(this).data(DATA_KEY);
if (!data) {
$(this).data(DATA_KEY, data = new Dropdown(this));
data = new Dropdown(this);
$(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
@@ -159,7 +162,9 @@ var Dropdown = function ($) {
for (var i = 0; i < toggles.length; i++) {
var parent = Dropdown._getParentFromElement(toggles[i]);
var relatedTarget = { relatedTarget: toggles[i] };
var relatedTarget = {
relatedTarget: toggles[i]
};
if (!$(parent).hasClass(ClassName.ACTIVE)) {
continue;

File diff suppressed because one or more lines are too long

2
js/dist/modal.js vendored
View File

@@ -288,7 +288,7 @@ var Modal = function ($) {
var _this7 = this;
this._element.style.display = 'none';
this._element.setAttribute('aria-hidden', 'true');
this._element.setAttribute('aria-hidden', true);
this._showBackdrop(function () {
$(document.body).removeClass(ClassName.OPEN);
_this7._resetAdjustments();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -249,7 +249,7 @@ var ScrollSpy = function ($) {
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config || null;
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
if (!data) {
data = new ScrollSpy(this, _config);

File diff suppressed because one or more lines are too long

4
js/dist/tab.js vendored
View File

@@ -163,7 +163,7 @@ var Tab = function ($) {
if (active) {
$(active).removeClass(ClassName.ACTIVE);
var dropdownChild = $(active).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
var dropdownChild = $(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
if (dropdownChild) {
$(dropdownChild).removeClass(ClassName.ACTIVE);
@@ -205,7 +205,7 @@ var Tab = function ($) {
var data = $this.data(DATA_KEY);
if (!data) {
data = data = new Tab(this);
data = new Tab(this);
$this.data(DATA_KEY, data);
}

2
js/dist/tab.js.map vendored

File diff suppressed because one or more lines are too long

2
js/dist/tooltip.js vendored
View File

@@ -522,7 +522,7 @@ var Tooltip = function ($) {
Tooltip._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $(this).data(DATA_KEY);
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' ? config : null;
var _config = (typeof config === 'undefined' ? 'undefined' : _typeof(config)) === 'object' && config;
if (!data && /dispose|hide/.test(config)) {
return;

File diff suppressed because one or more lines are too long

15
js/dist/util.js vendored
View File

@@ -55,7 +55,9 @@ var Util = function ($) {
for (var name in TransitionEndEvent) {
if (el.style[name] !== undefined) {
return { end: TransitionEndEvent[name] };
return {
end: TransitionEndEvent[name]
};
}
}
@@ -102,9 +104,8 @@ var Util = function ($) {
getUID: function getUID(prefix) {
do {
/* eslint-disable no-bitwise */
// eslint-disable-next-line no-bitwise
prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
/* eslint-enable no-bitwise */
} while (document.getElementById(prefix));
return prefix;
},
@@ -132,13 +133,7 @@ var Util = function ($) {
if (configTypes.hasOwnProperty(property)) {
var expectedTypes = configTypes[property];
var value = config[property];
var valueType = void 0;
if (value && isElement(value)) {
valueType = 'element';
} else {
valueType = toType(value);
}
var valueType = value && isElement(value) ? 'element' : toType(value);
if (!new RegExp(expectedTypes).test(valueType)) {
throw new Error(componentName.toUpperCase() + ': ' + ('Option "' + property + '" provided type "' + valueType + '" ') + ('but expected type "' + expectedTypes + '".'));

2
js/dist/util.js.map vendored

File diff suppressed because one or more lines are too long