1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 11:00:56 +02:00
This commit is contained in:
Mark Otto
2018-12-15 15:13:22 -08:00
committed by XhmikosR
parent ffd3402a92
commit ee72e7838d
34 changed files with 302 additions and 86 deletions

2
js/dist/button.js vendored
View File

@@ -47,7 +47,7 @@
var Selector = {
DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
DATA_TOGGLE: '[data-toggle="buttons"]',
INPUT: 'input',
INPUT: 'input:not([type="hidden"])',
ACTIVE: '.active',
BUTTON: '.btn'
};

File diff suppressed because one or more lines are too long

2
js/dist/dropdown.js vendored
View File

@@ -502,7 +502,7 @@
var isActive = $(parent).hasClass(ClassName.SHOW);
if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
if (event.which === ESCAPE_KEYCODE) {
var toggle = parent.querySelector(Selector.DATA_TOGGLE);
$(toggle).trigger('focus');

File diff suppressed because one or more lines are too long

4
js/dist/modal.js vendored
View File

@@ -285,6 +285,8 @@
this._element.removeAttribute('aria-hidden');
this._element.setAttribute('aria-modal', true);
this._element.scrollTop = 0;
if (transition) {
@@ -364,6 +366,8 @@
this._element.setAttribute('aria-hidden', true);
this._element.removeAttribute('aria-modal');
this._isTransitioning = false;
this._showBackdrop(function () {

File diff suppressed because one or more lines are too long

13
js/dist/toast.js vendored
View File

@@ -83,7 +83,8 @@
var ClassName = {
FADE: 'fade',
HIDE: 'hide',
SHOW: 'show'
SHOW: 'show',
SHOWING: 'showing'
};
var DefaultType = {
animation: 'boolean',
@@ -130,6 +131,10 @@
}
var complete = function complete() {
_this._element.classList.remove(ClassName.SHOWING);
_this._element.classList.add(ClassName.SHOW);
$(_this._element).trigger(Event.SHOWN);
if (_this._config.autohide) {
@@ -137,7 +142,9 @@
}
};
this._element.classList.add(ClassName.SHOW);
this._element.classList.remove(ClassName.HIDE);
this._element.classList.add(ClassName.SHOWING);
if (this._config.animation) {
var transitionDuration = Util.getTransitionDurationFromElement(this._element);
@@ -198,6 +205,8 @@
var _this4 = this;
var complete = function complete() {
_this4._element.classList.add(ClassName.HIDE);
$(_this4._element).trigger(Event.HIDDEN);
};

File diff suppressed because one or more lines are too long

19
js/dist/tooltip.js vendored
View File

@@ -259,7 +259,8 @@
if (this.isWithContent() && this._isEnabled) {
$(this.element).trigger(showEvent);
var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
var shadowRoot = Util.findShadowRoot(this.element);
var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
if (showEvent.isDefaultPrevented() || !isInTheDom) {
return;
@@ -280,7 +281,9 @@
var attachment = this._getAttachment(placement);
this.addAttachmentClass(attachment);
var container = this.config.container === false ? document.body : $(document).find(this.config.container);
var container = this._getContainer();
$(tip).data(this.constructor.DATA_KEY, this);
if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
@@ -452,6 +455,18 @@
}; // Private
_proto._getContainer = function _getContainer() {
if (this.config.container === false) {
return document.body;
}
if (Util.isElement(this.config.container)) {
return $(this.config.container);
}
return $(document).find(this.config.container);
};
_proto._getAttachment = function _getAttachment(placement) {
return AttachmentMap[placement.toUpperCase()];
};

File diff suppressed because one or more lines are too long

22
js/dist/util.js vendored
View File

@@ -136,6 +136,28 @@
}
}
}
},
findShadowRoot: function findShadowRoot(element) {
if (!document.documentElement.attachShadow) {
return null;
} // Can find the shadow root otherwise it'll return the document
if (typeof element.getRootNode === 'function') {
var root = element.getRootNode();
return root instanceof ShadowRoot ? root : null;
}
if (element instanceof ShadowRoot) {
return element;
} // when we don't find a shadow root
if (!element.parentNode) {
return null;
}
return Util.findShadowRoot(element.parentNode);
}
};
setTransitionEndSupport();

2
js/dist/util.js.map vendored

File diff suppressed because one or more lines are too long