diff options
| author | Mark Otto <[email protected]> | 2017-03-26 11:26:31 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-03-26 11:26:31 -0700 |
| commit | 4ab06ca4534da28858c013e765a9ad34f508e4d7 (patch) | |
| tree | 5b083913dcf7f8b1e5133e7d7114b0f63e65bc91 /docs/dist/js/bootstrap.js | |
| parent | e20d744bdf6ea396ef6d29ab5c1976635d861b29 (diff) | |
| download | bootstrap-4ab06ca4534da28858c013e765a9ad34f508e4d7.tar.xz bootstrap-4ab06ca4534da28858c013e765a9ad34f508e4d7.zip | |
grunt
Diffstat (limited to 'docs/dist/js/bootstrap.js')
| -rw-r--r-- | docs/dist/js/bootstrap.js | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/docs/dist/js/bootstrap.js b/docs/dist/js/bootstrap.js index d16517bba..0bdca5ef8 100644 --- a/docs/dist/js/bootstrap.js +++ b/docs/dist/js/bootstrap.js @@ -791,9 +791,13 @@ var Carousel = function ($) { }; Carousel.prototype._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { + var targetIndex = this._getItemIndex(relatedTarget); + var fromIndex = this._getItemIndex($(this._element).find(Selector.ACTIVE_ITEM)[0]); var slideEvent = $.Event(Event.SLIDE, { relatedTarget: relatedTarget, - direction: eventDirectionName + direction: eventDirectionName, + from: fromIndex, + to: targetIndex }); $(this._element).trigger(slideEvent); @@ -817,8 +821,9 @@ var Carousel = function ($) { var _this5 = this; var activeElement = $(this._element).find(Selector.ACTIVE_ITEM)[0]; + var activeElementIndex = this._getItemIndex(activeElement); var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); - + var nextElementIndex = this._getItemIndex(nextElement); var isCycling = Boolean(this._interval); var directionalClassName = void 0; @@ -860,7 +865,9 @@ var Carousel = function ($) { var slidEvent = $.Event(Event.SLID, { relatedTarget: nextElement, - direction: eventDirectionName + direction: eventDirectionName, + from: activeElementIndex, + to: nextElementIndex }); if (Util.supportsTransitionEnd() && $(this._element).hasClass(ClassName.SLIDE)) { @@ -1854,6 +1861,10 @@ var Modal = function ($) { this._scrollbarWidth = null; }; + Modal.prototype.handleUpdate = function handleUpdate() { + this._adjustDialog(); + }; + // private Modal.prototype._getConfig = function _getConfig(config) { @@ -1935,7 +1946,7 @@ var Modal = function ($) { if (this._isShown) { $(window).on(Event.RESIZE, function (event) { - return _this14._handleUpdate(event); + return _this14.handleUpdate(event); }); } else { $(window).off(Event.RESIZE); @@ -2036,10 +2047,6 @@ var Modal = function ($) { // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- - Modal.prototype._handleUpdate = function _handleUpdate() { - this._adjustDialog(); - }; - Modal.prototype._adjustDialog = function _adjustDialog() { var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; |
