1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-27 15:19:52 +02:00
This commit is contained in:
Mark Otto
2018-01-11 22:42:40 -08:00
parent 80d0943b95
commit 6d8d8639f3
42 changed files with 356 additions and 385 deletions

8
js/dist/alert.js vendored
View File

@@ -46,12 +46,12 @@ var Alert = function ($) {
function () {
function Alert(element) {
this._element = element;
} // getters
} // Getters
var _proto = Alert.prototype;
// public
// Public
_proto.close = function close(element) {
element = element || this._element;
@@ -69,7 +69,7 @@ var Alert = function ($) {
_proto.dispose = function dispose() {
$.removeData(this._element, DATA_KEY);
this._element = null;
}; // private
}; // Private
_proto._getRootElement = function _getRootElement(element) {
@@ -111,7 +111,7 @@ var Alert = function ($) {
_proto._destroyElement = function _destroyElement(element) {
$(element).detach().trigger(Event.CLOSED).remove();
}; // static
}; // Static
Alert._jQueryInterface = function _jQueryInterface(config) {

File diff suppressed because one or more lines are too long

6
js/dist/button.js vendored
View File

@@ -48,12 +48,12 @@ var Button = function ($) {
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;
@@ -101,7 +101,7 @@ var Button = function ($) {
_proto.dispose = function dispose() {
$.removeData(this._element, DATA_KEY);
this._element = null;
}; // static
}; // Static
Button._jQueryInterface = function _jQueryInterface(config) {

File diff suppressed because one or more lines are too long

15
js/dist/carousel.js vendored
View File

@@ -100,12 +100,12 @@ var Carousel = function ($) {
this._indicatorsElement = $(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);
@@ -195,7 +195,7 @@ var Carousel = function ($) {
this._isSliding = null;
this._activeElement = null;
this._indicatorsElement = null;
}; // private
}; // Private
_proto._getConfig = function _getConfig(config) {
@@ -221,7 +221,7 @@ var Carousel = function ($) {
});
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
@@ -260,7 +260,6 @@ var Carousel = function ($) {
break;
default:
return;
}
};
@@ -352,7 +351,7 @@ var Carousel = function ($) {
}
if (!activeElement || !nextElement) {
// some weirdness is happening, so we bail
// Some weirdness is happening, so we bail
return;
}
@@ -394,7 +393,7 @@ var Carousel = function ($) {
if (isCycling) {
this.cycle();
}
}; // static
}; // Static
Carousel._jQueryInterface = function _jQueryInterface(config) {
@@ -418,7 +417,7 @@ var Carousel = function ($) {
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]();

File diff suppressed because one or more lines are too long

22
js/dist/collapse.js vendored
View File

@@ -89,12 +89,12 @@ var Collapse = function ($) {
if (this._config.toggle) {
this.toggle();
}
} // getters
} // Getters
var _proto = Collapse.prototype;
// public
// Public
_proto.toggle = function toggle() {
if ($(this._element).hasClass(ClassName.SHOW)) {
this.hide();
@@ -116,7 +116,7 @@ var Collapse = function ($) {
if (this._parent) {
actives = $.makeArray($(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]"));
if (!actives.length) {
if (actives.length === 0) {
actives = null;
}
}
@@ -149,7 +149,7 @@ var Collapse = function ($) {
$(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
this._element.style[dimension] = 0;
if (this._triggerArray.length) {
if (this._triggerArray.length > 0) {
$(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
}
@@ -195,7 +195,7 @@ var Collapse = function ($) {
Util.reflow(this._element);
$(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);
@@ -239,12 +239,12 @@ var Collapse = function ($) {
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;
@@ -261,7 +261,7 @@ var Collapse = function ($) {
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];
@@ -281,11 +281,11 @@ var Collapse = function ($) {
if (element) {
var isOpen = $(element).hasClass(ClassName.SHOW);
if (triggerArray.length) {
if (triggerArray.length > 0) {
$(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
}
}
}; // static
}; // Static
Collapse._getTargetFromElement = function _getTargetFromElement(element) {
@@ -311,7 +311,7 @@ var Collapse = function ($) {
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]();

File diff suppressed because one or more lines are too long

26
js/dist/dropdown.js vendored
View File

@@ -100,12 +100,12 @@ var Dropdown = function ($) {
this._inNavbar = this._detectNavbar();
this._addEventListeners();
} // getters
} // Getters
var _proto = Dropdown.prototype;
// public
// Public
_proto.toggle = function toggle() {
if (this._element.disabled || $(this._element).hasClass(ClassName.DISABLED)) {
return;
@@ -138,10 +138,10 @@ var Dropdown = function ($) {
* 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 ($(parent).hasClass(ClassName.DROPUP)) {
if ($(this._menu).hasClass(ClassName.MENULEFT) || $(this._menu).hasClass(ClassName.MENURIGHT)) {
@@ -157,13 +157,13 @@ var Dropdown = function ($) {
}
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 && !$(parent).closest(Selector.NAVBAR_NAV).length) {
if ('ontouchstart' in document.documentElement && $(parent).closest(Selector.NAVBAR_NAV).length === 0) {
$('body').children().on('mouseover', null, $.noop);
}
@@ -194,7 +194,7 @@ var Dropdown = function ($) {
if (this._popper !== null) {
this._popper.scheduleUpdate();
}
}; // private
}; // Private
_proto._addEventListeners = function _addEventListeners() {
@@ -276,7 +276,7 @@ var Dropdown = function ($) {
}
};
return popperConfig;
}; // static
}; // Static
Dropdown._jQueryInterface = function _jQueryInterface(config) {
@@ -292,7 +292,7 @@ var Dropdown = function ($) {
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]();
@@ -334,7 +334,7 @@ var Dropdown = function ($) {
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
@@ -395,19 +395,19 @@ var Dropdown = function ($) {
var items = $(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++;
}

File diff suppressed because one or more lines are too long

2
js/dist/index.js vendored
View File

@@ -6,7 +6,7 @@
*/
(function ($) {
if (typeof $ === '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 = $.fn.jquery.split(' ')[0].split('.');

View File

@@ -1 +1 @@
{"version":3,"sources":["../src/index.js"],"names":["$","Error","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,KAAJ,CAAU,kGAAV,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIT,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGD,CAfH","file":"index.js","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new Error('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"]}
{"version":3,"sources":["../src/index.js"],"names":["$","TypeError","version","fn","jquery","split","minMajor","ltMajor","minMinor","minPatch","maxMajor","Error"],"mappings":"AAaA;;;;;;AAOA,CAAC,UAACA,CAAD,EAAO;AACN,MAAI,OAAOA,CAAP,KAAa,WAAjB,EAA8B;AAC5B,UAAM,IAAIC,SAAJ,CAAc,kGAAd,CAAN;AACD;;AAED,MAAMC,UAAUF,EAAEG,EAAF,CAAKC,MAAL,CAAYC,KAAZ,CAAkB,GAAlB,EAAuB,CAAvB,EAA0BA,KAA1B,CAAgC,GAAhC,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,UAAU,CAAhB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;AACA,MAAMC,WAAW,CAAjB;;AAEA,MAAIR,QAAQ,CAAR,IAAaK,OAAb,IAAwBL,QAAQ,CAAR,IAAaM,QAArC,IAAiDN,QAAQ,CAAR,MAAeI,QAAf,IAA2BJ,QAAQ,CAAR,MAAeM,QAA1C,IAAsDN,QAAQ,CAAR,IAAaO,QAApH,IAAgIP,QAAQ,CAAR,KAAcQ,QAAlJ,EAA4J;AAC1J,UAAM,IAAIC,KAAJ,CAAU,8EAAV,CAAN;AACD;AACF,CAfD,EAeGX,CAfH","file":"index.js","sourcesContent":["import $ from 'jquery'\nimport Alert from './alert'\nimport Button from './button'\nimport Carousel from './carousel'\nimport Collapse from './collapse'\nimport Dropdown from './dropdown'\nimport Modal from './modal'\nimport Popover from './popover'\nimport Scrollspy from './scrollspy'\nimport Tab from './tab'\nimport Tooltip from './tooltip'\nimport Util from './util'\n\n/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.0.0-alpha.6): index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n(($) => {\n if (typeof $ === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')\n }\n\n const version = $.fn.jquery.split(' ')[0].split('.')\n const minMajor = 1\n const ltMajor = 2\n const minMinor = 9\n const minPatch = 1\n const maxMajor = 4\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')\n }\n})($)\n\nexport {\n Util,\n Alert,\n Button,\n Carousel,\n Collapse,\n Dropdown,\n Modal,\n Popover,\n Scrollspy,\n Tab,\n Tooltip\n}\n"]}

18
js/dist/modal.js vendored
View File

@@ -86,12 +86,12 @@ var Modal = function ($) {
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);
};
@@ -204,7 +204,7 @@ var Modal = function ($) {
_proto.handleUpdate = function handleUpdate() {
this._adjustDialog();
}; // private
}; // Private
_proto._getConfig = function _getConfig(config) {
@@ -219,7 +219,7 @@ var Modal = function ($) {
var transition = Util.supportsTransitionEnd() && $(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);
}
@@ -262,9 +262,9 @@ var Modal = function ($) {
_proto._enforceFocus = function _enforceFocus() {
var _this4 = this;
$(document).off(Event.FOCUSIN) // guard against infinite focus loop
$(document).off(Event.FOCUSIN) // Guard against infinite focus loop
.on(Event.FOCUSIN, function (event) {
if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) {
if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
_this4._element.focus();
}
});
@@ -485,7 +485,7 @@ var Modal = function ($) {
var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarWidth;
}; // static
}; // Static
Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
@@ -501,7 +501,7 @@ var Modal = function ($) {
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);
@@ -550,7 +550,7 @@ var Modal = function ($) {
var $target = $(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;
}

File diff suppressed because one or more lines are too long

12
js/dist/popover.js vendored
View File

@@ -75,7 +75,7 @@ var Popover = function ($) {
var _proto = Popover.prototype;
// overrides
// Overrides
_proto.isWithContent = function isWithContent() {
return this.getTitle() || this._getContent();
};
@@ -90,7 +90,7 @@ var Popover = function ($) {
};
_proto.setContent = function setContent() {
var $tip = $(this.getTipElement()); // we use append for html objects to maintain js events
var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
@@ -102,7 +102,7 @@ var Popover = function ($) {
this.setElementContent($tip.find(Selector.CONTENT), content);
$tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
}; // private
}; // Private
_proto._getContent = function _getContent() {
@@ -116,7 +116,7 @@ var Popover = function ($) {
if (tabClass !== null && tabClass.length > 0) {
$tip.removeClass(tabClass.join(''));
}
}; // static
}; // Static
Popover._jQueryInterface = function _jQueryInterface(config) {
@@ -136,7 +136,7 @@ var Popover = function ($) {
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]();
@@ -146,7 +146,7 @@ var Popover = function ($) {
_createClass(Popover, null, [{
key: "VERSION",
// getters
// Getters
get: function get() {
return VERSION;
}

File diff suppressed because one or more lines are too long

14
js/dist/scrollspy.js vendored
View File

@@ -84,16 +84,16 @@ var ScrollSpy = function ($) {
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 = [];
@@ -112,7 +112,7 @@ var ScrollSpy = function ($) {
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 [$(target)[offsetMethod]().top + offsetBase, targetSelector];
}
}
@@ -140,7 +140,7 @@ var ScrollSpy = function ($) {
this._targets = null;
this._activeTarget = null;
this._scrollHeight = null;
}; // private
}; // Private
_proto._getConfig = function _getConfig(config) {
@@ -244,7 +244,7 @@ var ScrollSpy = function ($) {
_proto._clear = function _clear() {
$(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
}; // static
}; // Static
ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
@@ -260,7 +260,7 @@ var ScrollSpy = function ($) {
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]();

File diff suppressed because one or more lines are too long

10
js/dist/tab.js vendored
View File

@@ -56,12 +56,12 @@ var Tab = function ($) {
function () {
function Tab(element) {
this._element = element;
} // getters
} // Getters
var _proto = Tab.prototype;
// public
// Public
_proto.show = function show() {
var _this = this;
@@ -124,7 +124,7 @@ var Tab = function ($) {
_proto.dispose = function dispose() {
$.removeData(this._element, DATA_KEY);
this._element = null;
}; // private
}; // Private
_proto._activate = function _activate(element, container, callback) {
@@ -188,7 +188,7 @@ var Tab = function ($) {
if (callback) {
callback();
}
}; // static
}; // Static
Tab._jQueryInterface = function _jQueryInterface(config) {
@@ -203,7 +203,7 @@ var Tab = function ($) {
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]();

2
js/dist/tab.js.map vendored

File diff suppressed because one or more lines are too long

22
js/dist/tooltip.js vendored
View File

@@ -106,7 +106,7 @@ var Tooltip = function ($) {
* 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
@@ -114,19 +114,19 @@ var Tooltip = function ($) {
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;
};
@@ -261,7 +261,7 @@ var Tooltip = function ($) {
_this._handlePopperPlacementChange(data);
}
});
$(tip).addClass(ClassName.SHOW); // if this is a touch-enabled device we add extra
$(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
@@ -324,7 +324,7 @@ var Tooltip = function ($) {
return;
}
$(tip).removeClass(ClassName.SHOW); // if this is a touch-enabled device we remove the extra
$(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) {
@@ -348,7 +348,7 @@ var Tooltip = function ($) {
if (this._popper !== null) {
this._popper.scheduleUpdate();
}
}; // protected
}; // Protected
_proto.isWithContent = function isWithContent() {
@@ -374,7 +374,7 @@ var Tooltip = function ($) {
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 (!$(content).parent().is($element)) {
$element.empty().append(content);
@@ -395,7 +395,7 @@ var Tooltip = function ($) {
}
return title;
}; // private
}; // Private
_proto._getAttachment = function _getAttachment(placement) {
@@ -584,7 +584,7 @@ var Tooltip = function ($) {
this.hide();
this.show();
this.config.animation = initConfigAnimation;
}; // static
}; // Static
Tooltip._jQueryInterface = function _jQueryInterface(config) {
@@ -604,7 +604,7 @@ var Tooltip = function ($) {
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]();

File diff suppressed because one or more lines are too long

10
js/dist/util.js vendored
View File

@@ -11,7 +11,7 @@ var Util = function ($) {
* ------------------------------------------------------------------------
*/
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();
@@ -32,7 +32,7 @@ var Util = function ($) {
}
function transitionEndTest() {
if (window.QUnit) {
if (typeof window !== 'undefined' && window.QUnit) {
return false;
}
@@ -66,7 +66,7 @@ var Util = function ($) {
}
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 $.escapeSelector === 'function' ? $.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1');
return selector;
@@ -93,7 +93,7 @@ var Util = function ($) {
if (!selector || selector === '#') {
selector = element.getAttribute('href') || '';
} // if it's an ID
} // If it's an ID
if (selector.charAt(0) === '#') {
@@ -103,7 +103,7 @@ var Util = function ($) {
try {
var $selector = $(document).find(selector);
return $selector.length > 0 ? selector : null;
} catch (error) {
} catch (err) {
return null;
}
},

2
js/dist/util.js.map vendored

File diff suppressed because one or more lines are too long