assets/javascripts/bootstrap.js in bootstrap-4.0.0.beta3 vs assets/javascripts/bootstrap.js in bootstrap-4.0.0
- old
+ new
@@ -1,8 +1,8 @@
/*!
- * Bootstrap v4.0.0-beta.3 (https://getbootstrap.com)
- * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
+ * Bootstrap v4.0.0 (https://getbootstrap.com)
+ * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :
typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :
@@ -52,11 +52,11 @@
subClass.__proto__ = superClass;
}
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): util.js
+ * Bootstrap (v4.0.0): util.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Util = function ($$$1) {
@@ -64,11 +64,11 @@
* ------------------------------------------------------------------------
* Private TransitionEnd Helpers
* ------------------------------------------------------------------------
*/
var transition = false;
- var MAX_UID = 1000000; // shoutout AngusCroll (https://goo.gl/pxwQGp)
+ var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) {
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
}
@@ -85,11 +85,11 @@
}
};
}
function transitionEndTest() {
- if (window.QUnit) {
+ if (typeof window !== 'undefined' && window.QUnit) {
return false;
}
return {
end: 'transitionend'
@@ -119,11 +119,11 @@
$$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
}
}
function escapeId(selector) {
- // we escape IDs in case of special selectors (selector = '#myId:something')
+ // We escape IDs in case of special selectors (selector = '#myId:something')
// $.escapeSelector does not exist in jQuery < 3
selector = typeof $$$1.escapeSelector === 'function' ? $$$1.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1');
return selector;
}
/**
@@ -146,21 +146,21 @@
getSelectorFromElement: function getSelectorFromElement(element) {
var selector = element.getAttribute('data-target');
if (!selector || selector === '#') {
selector = element.getAttribute('href') || '';
- } // if it's an ID
+ } // If it's an ID
if (selector.charAt(0) === '#') {
selector = escapeId(selector);
}
try {
var $selector = $$$1(document).find(selector);
return $selector.length > 0 ? selector : null;
- } catch (error) {
+ } catch (err) {
return null;
}
},
reflow: function reflow(element) {
return element.offsetHeight;
@@ -192,11 +192,11 @@
return Util;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): alert.js
+ * Bootstrap (v4.0.0): alert.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Alert = function ($$$1) {
@@ -204,11 +204,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'alert';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.alert';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
@@ -235,16 +235,16 @@
var Alert =
/*#__PURE__*/
function () {
function Alert(element) {
this._element = element;
- } // getters
+ } // Getters
var _proto = Alert.prototype;
- // public
+ // Public
_proto.close = function close(element) {
element = element || this._element;
var rootElement = this._getRootElement(element);
@@ -258,11 +258,11 @@
};
_proto.dispose = function dispose() {
$$$1.removeData(this._element, DATA_KEY);
this._element = null;
- }; // private
+ }; // Private
_proto._getRootElement = function _getRootElement(element) {
var selector = Util.getSelectorFromElement(element);
var parent = false;
@@ -300,11 +300,11 @@
}).emulateTransitionEnd(TRANSITION_DURATION);
};
_proto._destroyElement = function _destroyElement(element) {
$$$1(element).detach().trigger(Event.CLOSED).remove();
- }; // static
+ }; // Static
Alert._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var $element = $$$1(this);
@@ -364,11 +364,11 @@
return Alert;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): button.js
+ * Bootstrap (v4.0.0): button.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Button = function ($$$1) {
@@ -376,11 +376,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'button';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.button';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var ClassName = {
@@ -409,16 +409,16 @@
var Button =
/*#__PURE__*/
function () {
function Button(element) {
this._element = element;
- } // getters
+ } // Getters
var _proto = Button.prototype;
- // public
+ // Public
_proto.toggle = function toggle() {
var triggerChangeEvent = true;
var addAriaPressed = true;
var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
@@ -462,11 +462,11 @@
};
_proto.dispose = function dispose() {
$$$1.removeData(this._element, DATA_KEY);
this._element = null;
- }; // static
+ }; // Static
Button._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -527,11 +527,11 @@
return Button;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): carousel.js
+ * Bootstrap (v4.0.0): carousel.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Carousel = function ($$$1) {
@@ -539,11 +539,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'carousel';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.carousel';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 600;
@@ -622,16 +622,16 @@
this._config = this._getConfig(config);
this._element = $$$1(element)[0];
this._indicatorsElement = $$$1(this._element).find(Selector.INDICATORS)[0];
this._addEventListeners();
- } // getters
+ } // Getters
var _proto = Carousel.prototype;
- // public
+ // Public
_proto.next = function next() {
if (!this._isSliding) {
this._slide(Direction.NEXT);
}
};
@@ -717,11 +717,11 @@
this._interval = null;
this._isPaused = null;
this._isSliding = null;
this._activeElement = null;
this._indicatorsElement = null;
- }; // private
+ }; // Private
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
@@ -743,11 +743,11 @@
}).on(Event.MOUSELEAVE, function (event) {
return _this2.cycle(event);
});
if ('ontouchstart' in document.documentElement) {
- // if it's a touch-enabled device, mouseenter/leave are fired as
+ // If it's a touch-enabled device, mouseenter/leave are fired as
// part of the mouse compatibility events on first tap - the carousel
// would stop cycling until user tapped out of it;
// here, we listen for touchend, explicitly pause the carousel
// (as if it's the second time we tap on it, mouseenter compat event
// is NOT fired) and after a timeout (to allow for mouse compatibility
@@ -782,11 +782,10 @@
event.preventDefault();
this.next();
break;
default:
- return;
}
};
_proto._getItemIndex = function _getItemIndex(element) {
this._items = $$$1.makeArray($$$1(element).parent().find(Selector.ITEM));
@@ -874,11 +873,11 @@
if (slideEvent.isDefaultPrevented()) {
return;
}
if (!activeElement || !nextElement) {
- // some weirdness is happening, so we bail
+ // Some weirdness is happening, so we bail
return;
}
this._isSliding = true;
@@ -916,11 +915,11 @@
}
if (isCycling) {
this.cycle();
}
- }; // static
+ }; // Static
Carousel._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -940,11 +939,11 @@
if (typeof config === 'number') {
data.to(config);
} else if (typeof action === 'string') {
if (typeof data[action] === 'undefined') {
- throw new Error("No method named \"" + action + "\"");
+ throw new TypeError("No method named \"" + action + "\"");
}
data[action]();
} else if (_config.interval) {
data.pause();
@@ -1027,11 +1026,11 @@
return Carousel;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): collapse.js
+ * Bootstrap (v4.0.0): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Collapse = function ($$$1) {
@@ -1039,11 +1038,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'collapse';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.collapse';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 600;
@@ -1096,10 +1095,12 @@
for (var i = 0; i < tabToggles.length; i++) {
var elem = tabToggles[i];
var selector = Util.getSelectorFromElement(elem);
if (selector !== null && $$$1(selector).filter(element).length > 0) {
+ this._selector = selector;
+
this._triggerArray.push(elem);
}
}
this._parent = this._config.parent ? this._getParent() : null;
@@ -1109,16 +1110,16 @@
}
if (this._config.toggle) {
this.toggle();
}
- } // getters
+ } // Getters
var _proto = Collapse.prototype;
- // public
+ // Public
_proto.toggle = function toggle() {
if ($$$1(this._element).hasClass(ClassName.SHOW)) {
this.hide();
} else {
this.show();
@@ -1134,19 +1135,19 @@
var actives;
var activesData;
if (this._parent) {
- actives = $$$1.makeArray($$$1(this._parent).children().children(Selector.ACTIVES));
+ actives = $$$1.makeArray($$$1(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]"));
- if (!actives.length) {
+ if (actives.length === 0) {
actives = null;
}
}
if (actives) {
- activesData = $$$1(actives).data(DATA_KEY);
+ activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
if (activesData && activesData._isTransitioning) {
return;
}
}
@@ -1157,11 +1158,11 @@
if (startEvent.isDefaultPrevented()) {
return;
}
if (actives) {
- Collapse._jQueryInterface.call($$$1(actives), 'hide');
+ Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
if (!activesData) {
$$$1(actives).data(DATA_KEY, null);
}
}
@@ -1169,11 +1170,11 @@
var dimension = this._getDimension();
$$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
this._element.style[dimension] = 0;
- if (this._triggerArray.length) {
+ if (this._triggerArray.length > 0) {
$$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
}
this.setTransitioning(true);
@@ -1215,11 +1216,11 @@
this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
Util.reflow(this._element);
$$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
- if (this._triggerArray.length) {
+ if (this._triggerArray.length > 0) {
for (var i = 0; i < this._triggerArray.length; i++) {
var trigger = this._triggerArray[i];
var selector = Util.getSelectorFromElement(trigger);
if (selector !== null) {
@@ -1259,16 +1260,16 @@
this._config = null;
this._parent = null;
this._element = null;
this._triggerArray = null;
this._isTransitioning = null;
- }; // private
+ }; // Private
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
- config.toggle = Boolean(config.toggle); // coerce string values
+ config.toggle = Boolean(config.toggle); // Coerce string values
Util.typeCheckConfig(NAME, config, DefaultType);
return config;
};
@@ -1281,11 +1282,11 @@
var _this3 = this;
var parent = null;
if (Util.isElement(this._config.parent)) {
- parent = this._config.parent; // it's a jQuery object
+ parent = this._config.parent; // It's a jQuery object
if (typeof this._config.parent.jquery !== 'undefined') {
parent = this._config.parent[0];
}
} else {
@@ -1301,15 +1302,15 @@
_proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
if (element) {
var isOpen = $$$1(element).hasClass(ClassName.SHOW);
- if (triggerArray.length) {
+ if (triggerArray.length > 0) {
$$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
}
}
- }; // static
+ }; // Static
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
var selector = Util.getSelectorFromElement(element);
return selector ? $$$1(selector)[0] : null;
@@ -1331,11 +1332,11 @@
$this.data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
@@ -1394,11 +1395,11 @@
return Collapse;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): dropdown.js
+ * Bootstrap (v4.0.0): dropdown.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Dropdown = function ($$$1) {
@@ -1406,11 +1407,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'dropdown';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.dropdown';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
@@ -1489,16 +1490,16 @@
this._config = this._getConfig(config);
this._menu = this._getMenuElement();
this._inNavbar = this._detectNavbar();
this._addEventListeners();
- } // getters
+ } // Getters
var _proto = Dropdown.prototype;
- // public
+ // Public
_proto.toggle = function toggle() {
if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
return;
}
@@ -1527,14 +1528,14 @@
/**
* Check for Popper dependency
* Popper - https://popper.js.org
*/
if (typeof Popper === 'undefined') {
- throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)');
+ throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
}
- var element = this._element; // for dropup with alignment we use the parent as popper container
+ var element = this._element; // For dropup with alignment we use the parent as popper container
if ($$$1(parent).hasClass(ClassName.DROPUP)) {
if ($$$1(this._menu).hasClass(ClassName.MENULEFT) || $$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
element = parent;
}
@@ -1546,17 +1547,17 @@
if (this._config.boundary !== 'scrollParent') {
$$$1(parent).addClass(ClassName.POSITION_STATIC);
}
this._popper = new Popper(element, this._menu, this._getPopperConfig());
- } // if this is a touch-enabled device we add extra
+ } // If this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
- if ('ontouchstart' in document.documentElement && !$$$1(parent).closest(Selector.NAVBAR_NAV).length) {
+ if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
$$$1('body').children().on('mouseover', null, $$$1.noop);
}
this._element.focus();
@@ -1583,11 +1584,11 @@
this._inNavbar = this._detectNavbar();
if (this._popper !== null) {
this._popper.scheduleUpdate();
}
- }; // private
+ }; // Private
_proto._addEventListeners = function _addEventListeners() {
var _this = this;
@@ -1665,11 +1666,11 @@
boundariesElement: this._config.boundary
}
}
};
return popperConfig;
- }; // static
+ }; // Static
Dropdown._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -1681,11 +1682,11 @@
$$$1(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
@@ -1723,11 +1724,11 @@
var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
$$$1(parent).trigger(hideEvent);
if (hideEvent.isDefaultPrevented()) {
continue;
- } // if this is a touch-enabled device we remove the extra
+ } // If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
$$$1('body').children().off('mouseover', null, $$$1.noop);
@@ -1746,12 +1747,13 @@
if (selector) {
parent = $$$1(selector)[0];
}
return parent || element.parentNode;
- };
+ }; // eslint-disable-next-line complexity
+
Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
// If not input/textarea:
// - And not a key in REGEXP_KEYDOWN => not a dropdown command
// If input/textarea:
// - If space key => not a dropdown command
@@ -1783,23 +1785,23 @@
return;
}
var items = $$$1(parent).find(Selector.VISIBLE_ITEMS).get();
- if (!items.length) {
+ if (items.length === 0) {
return;
}
var index = items.indexOf(event.target);
if (event.which === ARROW_UP_KEYCODE && index > 0) {
- // up
+ // Up
index--;
}
if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
- // down
+ // Down
index++;
}
if (index < 0) {
index = 0;
@@ -1858,11 +1860,11 @@
return Dropdown;
}($, Popper);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): modal.js
+ * Bootstrap (v4.0.0): modal.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Modal = function ($$$1) {
@@ -1870,11 +1872,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'modal';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.modal';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 300;
@@ -1939,16 +1941,16 @@
this._isShown = false;
this._isBodyOverflowing = false;
this._ignoreBackdropClick = false;
this._originalBodyPadding = 0;
this._scrollbarWidth = 0;
- } // getters
+ } // Getters
var _proto = Modal.prototype;
- // public
+ // Public
_proto.toggle = function toggle(relatedTarget) {
return this._isShown ? this.hide() : this.show(relatedTarget);
};
_proto.show = function show(relatedTarget) {
@@ -2057,11 +2059,11 @@
this._scrollbarWidth = null;
};
_proto.handleUpdate = function handleUpdate() {
this._adjustDialog();
- }; // private
+ }; // Private
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
Util.typeCheckConfig(NAME, config, DefaultType);
@@ -2072,11 +2074,11 @@
var _this3 = this;
var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
- // don't move modals dom position
+ // Don't move modal's DOM position
document.body.appendChild(this._element);
}
this._element.style.display = 'block';
@@ -2115,13 +2117,13 @@
};
_proto._enforceFocus = function _enforceFocus() {
var _this4 = this;
- $$$1(document).off(Event.FOCUSIN) // guard against infinite focus loop
+ $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
.on(Event.FOCUSIN, function (event) {
- if (document !== event.target && _this4._element !== event.target && !$$$1(_this4._element).has(event.target).length) {
+ if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
_this4._element.focus();
}
});
};
@@ -2338,11 +2340,11 @@
scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
document.body.appendChild(scrollDiv);
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarWidth;
- }; // static
+ }; // Static
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -2354,11 +2356,11 @@
$$$1(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config](relatedTarget);
} else if (_config.show) {
data.show(relatedTarget);
@@ -2402,11 +2404,11 @@
event.preventDefault();
}
var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
if (showEvent.isDefaultPrevented()) {
- // only register focus restorer if modal will actually get shown
+ // Only register focus restorer if modal will actually get shown
return;
}
$target.one(Event.HIDDEN, function () {
if ($$$1(_this10).is(':visible')) {
@@ -2434,11 +2436,11 @@
return Modal;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): tooltip.js
+ * Bootstrap (v4.0.0): tooltip.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Tooltip = function ($$$1) {
@@ -2446,11 +2448,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'tooltip';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.tooltip';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
var CLASS_PREFIX = 'bs-tooltip';
@@ -2535,31 +2537,31 @@
/**
* Check for Popper dependency
* Popper - https://popper.js.org
*/
if (typeof Popper === 'undefined') {
- throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)');
+ throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
} // private
this._isEnabled = true;
this._timeout = 0;
this._hoverState = '';
this._activeTrigger = {};
- this._popper = null; // protected
+ this._popper = null; // Protected
this.element = element;
this.config = this._getConfig(config);
this.tip = null;
this._setListeners();
- } // getters
+ } // Getters
var _proto = Tooltip.prototype;
- // public
+ // Public
_proto.enable = function enable() {
this._isEnabled = true;
};
_proto.disable = function disable() {
@@ -2690,11 +2692,11 @@
},
onUpdate: function onUpdate(data) {
_this._handlePopperPlacementChange(data);
}
});
- $$$1(tip).addClass(ClassName.SHOW); // if this is a touch-enabled device we add extra
+ $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement) {
@@ -2753,11 +2755,11 @@
if (hideEvent.isDefaultPrevented()) {
return;
}
- $$$1(tip).removeClass(ClassName.SHOW); // if this is a touch-enabled device we remove the extra
+ $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) {
$$$1('body').children().off('mouseover', null, $$$1.noop);
}
@@ -2777,11 +2779,11 @@
_proto.update = function update() {
if (this._popper !== null) {
this._popper.scheduleUpdate();
}
- }; // protected
+ }; // Protected
_proto.isWithContent = function isWithContent() {
return Boolean(this.getTitle());
};
@@ -2803,11 +2805,11 @@
_proto.setElementContent = function setElementContent($element, content) {
var html = this.config.html;
if (typeof content === 'object' && (content.nodeType || content.jquery)) {
- // content is a DOM node or a jQuery
+ // Content is a DOM node or a jQuery
if (html) {
if (!$$$1(content).parent().is($element)) {
$element.empty().append(content);
}
} else {
@@ -2824,11 +2826,11 @@
if (!title) {
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
}
return title;
- }; // private
+ }; // Private
_proto._getAttachment = function _getAttachment(placement) {
return AttachmentMap[placement.toUpperCase()];
};
@@ -3013,11 +3015,11 @@
$$$1(tip).removeClass(ClassName.FADE);
this.config.animation = false;
this.hide();
this.show();
this.config.animation = initConfigAnimation;
- }; // static
+ }; // Static
Tooltip._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -3033,11 +3035,11 @@
$$$1(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
@@ -3099,11 +3101,11 @@
return Tooltip;
}($, Popper);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): popover.js
+ * Bootstrap (v4.0.0): popover.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Popover = function ($$$1) {
@@ -3111,11 +3113,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'popover';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.popover';
var EVENT_KEY = "." + DATA_KEY;
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var CLASS_PREFIX = 'bs-popover';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
@@ -3164,11 +3166,11 @@
return _Tooltip.apply(this, arguments) || this;
}
var _proto = Popover.prototype;
- // overrides
+ // Overrides
_proto.isWithContent = function isWithContent() {
return this.getTitle() || this._getContent();
};
_proto.addAttachmentClass = function addAttachmentClass(attachment) {
@@ -3179,11 +3181,11 @@
this.tip = this.tip || $$$1(this.config.template)[0];
return this.tip;
};
_proto.setContent = function setContent() {
- var $tip = $$$1(this.getTipElement()); // we use append for html objects to maintain js events
+ var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
var content = this._getContent();
@@ -3191,11 +3193,11 @@
content = content.call(this.element);
}
this.setElementContent($tip.find(Selector.CONTENT), content);
$tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
- }; // private
+ }; // Private
_proto._getContent = function _getContent() {
return this.element.getAttribute('data-content') || this.config.content;
};
@@ -3205,11 +3207,11 @@
var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
if (tabClass !== null && tabClass.length > 0) {
$tip.removeClass(tabClass.join(''));
}
- }; // static
+ }; // Static
Popover._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -3225,21 +3227,21 @@
$$$1(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
};
_createClass(Popover, null, [{
key: "VERSION",
- // getters
+ // Getters
get: function get() {
return VERSION;
}
}, {
key: "Default",
@@ -3292,11 +3294,11 @@
return Popover;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): scrollspy.js
+ * Bootstrap (v4.0.0): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var ScrollSpy = function ($$$1) {
@@ -3304,11 +3306,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'scrollspy';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.scrollspy';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var Default = {
@@ -3371,20 +3373,20 @@
return _this._process(event);
});
this.refresh();
this._process();
- } // getters
+ } // Getters
var _proto = ScrollSpy.prototype;
- // public
+ // Public
_proto.refresh = function refresh() {
var _this2 = this;
- var autoMethod = this._scrollElement !== this._scrollElement.window ? OffsetMethod.POSITION : OffsetMethod.OFFSET;
+ var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
this._offsets = [];
this._targets = [];
this._scrollHeight = this._getScrollHeight();
@@ -3399,11 +3401,11 @@
if (target) {
var targetBCR = target.getBoundingClientRect();
if (targetBCR.width || targetBCR.height) {
- // todo (fat): remove sketch reliance on jQuery position/offset
+ // TODO (fat): remove sketch reliance on jQuery position/offset
return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
}
}
return null;
@@ -3427,11 +3429,11 @@
this._selector = null;
this._offsets = null;
this._targets = null;
this._activeTarget = null;
this._scrollHeight = null;
- }; // private
+ }; // Private
_proto._getConfig = function _getConfig(config) {
config = _extends({}, Default, config);
@@ -3531,11 +3533,11 @@
});
};
_proto._clear = function _clear() {
$$$1(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
- }; // static
+ }; // Static
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var data = $$$1(this).data(DATA_KEY);
@@ -3547,11 +3549,11 @@
$$$1(this).data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
@@ -3603,11 +3605,11 @@
return ScrollSpy;
}($);
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.0.0-beta.3): tab.js
+ * Bootstrap (v4.0.0): tab.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
var Tab = function ($$$1) {
@@ -3615,11 +3617,11 @@
* ------------------------------------------------------------------------
* Constants
* ------------------------------------------------------------------------
*/
var NAME = 'tab';
- var VERSION = '4.0.0-beta.3';
+ var VERSION = '4.0.0';
var DATA_KEY = 'bs.tab';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
var TRANSITION_DURATION = 150;
@@ -3656,16 +3658,16 @@
var Tab =
/*#__PURE__*/
function () {
function Tab(element) {
this._element = element;
- } // getters
+ } // Getters
var _proto = Tab.prototype;
- // public
+ // Public
_proto.show = function show() {
var _this = this;
if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
return;
@@ -3724,11 +3726,11 @@
};
_proto.dispose = function dispose() {
$$$1.removeData(this._element, DATA_KEY);
this._element = null;
- }; // private
+ }; // Private
_proto._activate = function _activate(element, container, callback) {
var _this2 = this;
@@ -3788,11 +3790,11 @@
}
if (callback) {
callback();
}
- }; // static
+ }; // Static
Tab._jQueryInterface = function _jQueryInterface(config) {
return this.each(function () {
var $this = $$$1(this);
@@ -3803,11 +3805,11 @@
$this.data(DATA_KEY, data);
}
if (typeof config === 'string') {
if (typeof data[config] === 'undefined') {
- throw new Error("No method named \"" + config + "\"");
+ throw new TypeError("No method named \"" + config + "\"");
}
data[config]();
}
});
@@ -3857,10 +3859,10 @@
* --------------------------------------------------------------------------
*/
(function ($$$1) {
if (typeof $$$1 === 'undefined') {
- throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
+ throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
}
var version = $$$1.fn.jquery.split(' ')[0].split('.');
var minMajor = 1;
var ltMajor = 2;