1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 15:16:51 +02:00
This commit is contained in:
XhmikosR
2020-11-23 15:17:16 +02:00
committed by GitHub
parent 21737ed530
commit 3e823e0b75
52 changed files with 422 additions and 410 deletions

31
js/dist/tooltip.js vendored
View File

@@ -59,8 +59,8 @@
transitionDuration = _window$getComputedSt.transitionDuration,
transitionDelay = _window$getComputedSt.transitionDelay;
var floatTransitionDuration = parseFloat(transitionDuration);
var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
var floatTransitionDuration = Number.parseFloat(transitionDuration);
var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
@@ -69,7 +69,7 @@
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
};
var triggerTransitionEnd = function triggerTransitionEnd(element) {
@@ -141,7 +141,7 @@
var _window = window,
jQuery = _window.jQuery;
if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {
return jQuery;
}
@@ -162,7 +162,7 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
var uriAttrs = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']);
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
/**
* A pattern that recognizes a commonly useful subset of URLs that are safe.
@@ -182,8 +182,8 @@
var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
var attrName = attr.nodeName.toLowerCase();
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
if (allowedAttributeList.includes(attrName)) {
if (uriAttrs.has(attrName)) {
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
}
@@ -259,7 +259,7 @@
var el = elements[i];
var elName = el.nodeName.toLowerCase();
if (allowlistKeys.indexOf(elName) === -1) {
if (!allowlistKeys.includes(elName)) {
el.parentNode.removeChild(el);
return "continue";
}
@@ -300,7 +300,7 @@
var EVENT_KEY = "." + DATA_KEY;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'allowList', 'sanitizeFn'];
var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']);
var DefaultType = {
animation: 'boolean',
template: 'string',
@@ -375,7 +375,7 @@
var Tooltip = /*#__PURE__*/function () {
function Tooltip(element, config) {
if (typeof Popper__default['default'] === 'undefined') {
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)');
} // private
@@ -664,7 +664,7 @@
};
_proto.getTitle = function getTitle() {
var title = this.element.getAttribute('data-original-title');
var title = this.element.getAttribute('data-bs-original-title');
if (!title) {
title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
@@ -780,10 +780,11 @@
};
_proto._fixTitle = function _fixTitle() {
var titleType = typeof this.element.getAttribute('data-original-title');
var title = this.element.getAttribute('title');
var originalTitleType = typeof this.element.getAttribute('data-bs-original-title');
if (this.element.getAttribute('title') || titleType !== 'string') {
this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
if (title || originalTitleType !== 'string') {
this.element.setAttribute('data-bs-original-title', title || '');
this.element.setAttribute('title', '');
}
};
@@ -866,7 +867,7 @@
_proto._getConfig = function _getConfig(config) {
var dataAttributes = Manipulator__default['default'].getDataAttributes(this.element);
Object.keys(dataAttributes).forEach(function (dataAttr) {
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {
delete dataAttributes[dataAttr];
}
});