This commit is contained in:
Mark Otto 2016-10-31 21:14:23 -07:00
parent f734814f6b
commit 76d53404b5
36 changed files with 5718 additions and 205 deletions

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

6
js/dist/alert.js vendored
View file

@ -101,6 +101,8 @@ var Alert = function ($) {
};
Alert.prototype._removeElement = function _removeElement(element) {
var _this = this;
$(element).removeClass(ClassName.ACTIVE);
if (!Util.supportsTransitionEnd() || !$(element).hasClass(ClassName.FADE)) {
@ -108,7 +110,9 @@ var Alert = function ($) {
return;
}
$(element).one(Util.TRANSITION_END, $.proxy(this._destroyElement, this, element)).emulateTransitionEnd(TRANSITION_DURATION);
$(element).one(Util.TRANSITION_END, function (event) {
return _this._destroyElement(element, event);
}).emulateTransitionEnd(TRANSITION_DURATION);
};
Alert.prototype._destroyElement = function _destroyElement(element) {

BIN
js/dist/alert.js.map vendored

Binary file not shown.

20
js/dist/carousel.js vendored
View file

@ -151,7 +151,7 @@ var Carousel = function ($) {
}
if (this._config.interval && !this._isPaused) {
this._interval = setInterval($.proxy(document.visibilityState ? this.nextWhenVisible : this.next, this), this._config.interval);
this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
}
};
@ -207,12 +207,20 @@ var Carousel = function ($) {
};
Carousel.prototype._addEventListeners = function _addEventListeners() {
var _this2 = this;
if (this._config.keyboard) {
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));
$(this._element).on(Event.KEYDOWN, function (event) {
return _this2._keydown(event);
});
}
if (this._config.pause === 'hover' && !('ontouchstart' in document.documentElement)) {
$(this._element).on(Event.MOUSEENTER, $.proxy(this.pause, this)).on(Event.MOUSELEAVE, $.proxy(this.cycle, this));
$(this._element).on(Event.MOUSEENTER, function (event) {
return _this2.pause(event);
}).on(Event.MOUSELEAVE, function (event) {
return _this2.cycle(event);
});
}
};
@ -281,7 +289,7 @@ var Carousel = function ($) {
};
Carousel.prototype._slide = function _slide(direction, element) {
var _this2 = this;
var _this3 = this;
var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0];
var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
@ -334,10 +342,10 @@ var Carousel = function ($) {
$(activeElement).removeClass(ClassName.ACTIVE).removeClass(direction).removeClass(directionalClassName);
_this2._isSliding = false;
_this3._isSliding = false;
setTimeout(function () {
return $(_this2._element).trigger(slidEvent);
return $(_this3._element).trigger(slidEvent);
}, 0);
}).emulateTransitionEnd(TRANSITION_DURATION);
} else {

Binary file not shown.

66
js/dist/modal.js vendored
View file

@ -124,7 +124,9 @@ var Modal = function ($) {
this._setEscapeEvent();
this._setResizeEvent();
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, $.proxy(this.hide, this));
$(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
return _this.hide(event);
});
$(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
$(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
@ -134,10 +136,14 @@ var Modal = function ($) {
});
});
this._showBackdrop($.proxy(this._showElement, this, relatedTarget));
this._showBackdrop(function () {
return _this._showElement(relatedTarget);
});
};
Modal.prototype.hide = function hide(event) {
var _this2 = this;
if (event) {
event.preventDefault();
}
@ -164,7 +170,9 @@ var Modal = function ($) {
if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE)) {
$(this._element).one(Util.TRANSITION_END, $.proxy(this._hideModal, this)).emulateTransitionEnd(TRANSITION_DURATION);
$(this._element).one(Util.TRANSITION_END, function (event) {
return _this2._hideModal(event);
}).emulateTransitionEnd(TRANSITION_DURATION);
} else {
this._hideModal();
}
@ -198,7 +206,7 @@ var Modal = function ($) {
};
Modal.prototype._showElement = function _showElement(relatedTarget) {
var _this2 = this;
var _this3 = this;
var transition = Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.FADE);
@ -226,10 +234,10 @@ var Modal = function ($) {
});
var transitionComplete = function transitionComplete() {
if (_this2._config.focus) {
_this2._element.focus();
if (_this3._config.focus) {
_this3._element.focus();
}
$(_this2._element).trigger(shownEvent);
$(_this3._element).trigger(shownEvent);
};
if (transition) {
@ -240,23 +248,23 @@ var Modal = function ($) {
};
Modal.prototype._enforceFocus = function _enforceFocus() {
var _this3 = this;
var _this4 = this;
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
.on(Event.FOCUSIN, function (event) {
if (document !== event.target && _this3._element !== event.target && !$(_this3._element).has(event.target).length) {
_this3._element.focus();
if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) {
_this4._element.focus();
}
});
};
Modal.prototype._setEscapeEvent = function _setEscapeEvent() {
var _this4 = this;
var _this5 = this;
if (this._isShown && this._config.keyboard) {
$(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
if (event.which === ESCAPE_KEYCODE) {
_this4.hide();
_this5.hide();
}
});
} else if (!this._isShown) {
@ -265,23 +273,27 @@ var Modal = function ($) {
};
Modal.prototype._setResizeEvent = function _setResizeEvent() {
var _this6 = this;
if (this._isShown) {
$(window).on(Event.RESIZE, $.proxy(this._handleUpdate, this));
$(window).on(Event.RESIZE, function (event) {
return _this6._handleUpdate(event);
});
} else {
$(window).off(Event.RESIZE);
}
};
Modal.prototype._hideModal = function _hideModal() {
var _this5 = this;
var _this7 = this;
this._element.style.display = 'none';
this._element.setAttribute('aria-hidden', 'true');
this._showBackdrop(function () {
$(document.body).removeClass(ClassName.OPEN);
_this5._resetAdjustments();
_this5._resetScrollbar();
$(_this5._element).trigger(Event.HIDDEN);
_this7._resetAdjustments();
_this7._resetScrollbar();
$(_this7._element).trigger(Event.HIDDEN);
});
};
@ -293,7 +305,7 @@ var Modal = function ($) {
};
Modal.prototype._showBackdrop = function _showBackdrop(callback) {
var _this6 = this;
var _this8 = this;
var animate = $(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
@ -310,17 +322,17 @@ var Modal = function ($) {
$(this._backdrop).appendTo(document.body);
$(this._element).on(Event.CLICK_DISMISS, function (event) {
if (_this6._ignoreBackdropClick) {
_this6._ignoreBackdropClick = false;
if (_this8._ignoreBackdropClick) {
_this8._ignoreBackdropClick = false;
return;
}
if (event.target !== event.currentTarget) {
return;
}
if (_this6._config.backdrop === 'static') {
_this6._element.focus();
if (_this8._config.backdrop === 'static') {
_this8._element.focus();
} else {
_this6.hide();
_this8.hide();
}
});
@ -344,7 +356,7 @@ var Modal = function ($) {
$(this._backdrop).removeClass(ClassName.ACTIVE);
var callbackRemove = function callbackRemove() {
_this6._removeBackdrop();
_this8._removeBackdrop();
if (callback) {
callback();
}
@ -460,7 +472,7 @@ var Modal = function ($) {
*/
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
var _this7 = this;
var _this9 = this;
var target = void 0;
var selector = Util.getSelectorFromElement(this);
@ -482,8 +494,8 @@ var Modal = function ($) {
}
$target.one(Event.HIDDEN, function () {
if ($(_this7).is(':visible')) {
_this7.focus();
if ($(_this9).is(':visible')) {
_this9.focus();
}
});
});

BIN
js/dist/modal.js.map vendored

Binary file not shown.

12
js/dist/scrollspy.js vendored
View file

@ -77,6 +77,8 @@ var ScrollSpy = function ($) {
var ScrollSpy = function () {
function ScrollSpy(element, config) {
var _this = this;
_classCallCheck(this, ScrollSpy);
this._element = element;
@ -88,7 +90,9 @@ var ScrollSpy = function ($) {
this._activeTarget = null;
this._scrollHeight = 0;
$(this._scrollElement).on(Event.SCROLL, $.proxy(this._process, this));
$(this._scrollElement).on(Event.SCROLL, function (event) {
return _this._process(event);
});
this.refresh();
this._process();
@ -99,7 +103,7 @@ var ScrollSpy = function ($) {
// public
ScrollSpy.prototype.refresh = function refresh() {
var _this = this;
var _this2 = this;
var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
@ -132,8 +136,8 @@ var ScrollSpy = function ($) {
}).sort(function (a, b) {
return a[0] - b[0];
}).forEach(function (item) {
_this._offsets.push(item[0]);
_this._targets.push(item[1]);
_this2._offsets.push(item[0]);
_this2._targets.push(item[1]);
});
};

Binary file not shown.

6
js/dist/tab.js vendored
View file

@ -139,10 +139,14 @@ var Tab = function ($) {
// private
Tab.prototype._activate = function _activate(element, container, callback) {
var _this2 = this;
var active = $(container).find(Selector.ACTIVE_CHILD)[0];
var isTransitioning = callback && Util.supportsTransitionEnd() && (active && $(active).hasClass(ClassName.FADE) || Boolean($(container).find(Selector.FADE_CHILD)[0]));
var complete = $.proxy(this._transitionComplete, this, element, active, isTransitioning, callback);
var complete = function complete() {
return _this2._transitionComplete(element, active, isTransitioning, callback);
};
if (active && isTransitioning) {
$(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);

BIN
js/dist/tab.js.map vendored

Binary file not shown.

13
js/dist/tooltip.js vendored
View file

@ -204,6 +204,9 @@ var Tooltip = function ($) {
Tooltip.prototype.show = function show() {
var _this = this;
if ($(this.element).css('display') === 'none') {
throw new Error('Please use show on visible elements');
}
var showEvent = $.Event(this.constructor.Event.SHOW);
if (this.isWithContent() && this._isEnabled) {
@ -373,12 +376,18 @@ var Tooltip = function ($) {
triggers.forEach(function (trigger) {
if (trigger === 'click') {
$(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, $.proxy(_this3.toggle, _this3));
$(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
return _this3.toggle(event);
});
} else if (trigger !== Trigger.MANUAL) {
var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
$(_this3.element).on(eventIn, _this3.config.selector, $.proxy(_this3._enter, _this3)).on(eventOut, _this3.config.selector, $.proxy(_this3._leave, _this3));
$(_this3.element).on(eventIn, _this3.config.selector, function (event) {
return _this3._enter(event);
}).on(eventOut, _this3.config.selector, function (event) {
return _this3._leave(event);
});
}
});

BIN
js/dist/tooltip.js.map vendored

Binary file not shown.