mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-28 22:39:11 +02:00
chore(update): bump to 4.1.3
This commit is contained in:
@@ -140,6 +140,16 @@ class Alert {
|
||||
})
|
||||
}
|
||||
|
||||
static _handleDismiss(alertInstance) {
|
||||
return function (event) {
|
||||
if (event) {
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
alertInstance.close(this)
|
||||
}
|
||||
}
|
||||
|
||||
static _getInstance(element) {
|
||||
return Data.getData(element, DATA_KEY)
|
||||
}
|
||||
|
@@ -178,7 +178,7 @@ class Carousel {
|
||||
this._interval = null
|
||||
}
|
||||
|
||||
if (this._config.interval && !this._isPaused) {
|
||||
if (this._config && this._config.interval && !this._isPaused) {
|
||||
this._interval = setInterval(
|
||||
(document.visibilityState ? this.nextWhenVisible : this.next).bind(this),
|
||||
this._config.interval
|
||||
@@ -298,7 +298,7 @@ class Carousel {
|
||||
}
|
||||
|
||||
const end = (event) => {
|
||||
if (this._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
|
||||
if (this._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
|
||||
this.touchDeltaX = event.clientX - this.touchStartX
|
||||
}
|
||||
|
||||
@@ -464,6 +464,14 @@ class Carousel {
|
||||
activeElement.classList.add(directionalClassName)
|
||||
nextElement.classList.add(directionalClassName)
|
||||
|
||||
const nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10)
|
||||
if (nextElementInterval) {
|
||||
this._config.defaultInterval = this._config.defaultInterval || this._config.interval
|
||||
this._config.interval = nextElementInterval
|
||||
} else {
|
||||
this._config.interval = this._config.defaultInterval || this._config.interval
|
||||
}
|
||||
|
||||
const transitionDuration = Util.getTransitionDurationFromElement(activeElement)
|
||||
|
||||
EventHandler
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.1.1): dom/data.js
|
||||
* Bootstrap (v4.1.3): dom/data.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
@@ -3,7 +3,7 @@ import Util from '../util'
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.1.1): dom/eventHandler.js
|
||||
* Bootstrap (v4.1.3): dom/eventHandler.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -32,6 +32,7 @@ const EventHandler = (() => {
|
||||
'keydown', 'keypress', 'keyup',
|
||||
'orientationchange',
|
||||
'touchstart', 'touchmove', 'touchend', 'touchcancel',
|
||||
'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel',
|
||||
'gesturestart', 'gesturechange', 'gestureend',
|
||||
'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout',
|
||||
'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange',
|
||||
@@ -314,4 +315,19 @@ const EventHandler = (() => {
|
||||
}
|
||||
})()
|
||||
|
||||
/* istanbul ignore next */
|
||||
// focusin and focusout polyfill
|
||||
if (Polyfill.focusIn) {
|
||||
(() => {
|
||||
function listenerFocus(event) {
|
||||
EventHandler.trigger(event.target, 'focusin')
|
||||
}
|
||||
function listenerBlur(event) {
|
||||
EventHandler.trigger(event.target, 'focusout')
|
||||
}
|
||||
EventHandler.on(document, 'focus', 'input', listenerFocus)
|
||||
EventHandler.on(document, 'blur', 'input', listenerBlur)
|
||||
})()
|
||||
}
|
||||
|
||||
export default EventHandler
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.1.1): dom/manipulator.js
|
||||
* Bootstrap (v4.1.3): dom/manipulator.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
@@ -2,7 +2,7 @@ import Util from '../util'
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.1.1): dom/polyfill.js
|
||||
* Bootstrap (v4.1.3): dom/polyfill.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
@@ -3,7 +3,7 @@ import Util from '../util'
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v4.1.1): dom/selectorEngine.js
|
||||
* Bootstrap (v4.1.3): dom/selectorEngine.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
@@ -234,7 +234,7 @@ class Dropdown {
|
||||
|
||||
Manipulator.toggleClass(this._menu, ClassName.SHOW)
|
||||
Manipulator.toggleClass(parent, ClassName.SHOW)
|
||||
EventHandler.trigger(parent, Event.SHOWN, relatedTarget)
|
||||
EventHandler.trigger(parent, Event.HIDDEN, relatedTarget)
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
@@ -3,9 +3,7 @@ import Button from './button'
|
||||
import Carousel from './carousel'
|
||||
import Collapse from './collapse'
|
||||
import Dropdown from './dropdown'
|
||||
import EventHandler from './dom/eventHandler'
|
||||
import Modal from './modal'
|
||||
import Polyfill from './dom/polyfill'
|
||||
import Popover from './popover'
|
||||
import ScrollSpy from './scrollspy'
|
||||
import Tab from './tab'
|
||||
@@ -20,21 +18,6 @@ import Util from './util'
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* istanbul ignore next */
|
||||
// focusin and focusout polyfill
|
||||
if (Polyfill.focusIn) {
|
||||
(() => {
|
||||
function listenerFocus(event) {
|
||||
EventHandler.trigger(event.target, 'focusin')
|
||||
}
|
||||
function listenerBlur(event) {
|
||||
EventHandler.trigger(event.target, 'focusout')
|
||||
}
|
||||
EventHandler.on(document, 'focus', 'input', listenerFocus)
|
||||
EventHandler.on(document, 'blur', 'input', listenerBlur)
|
||||
})()
|
||||
}
|
||||
|
||||
export {
|
||||
Util,
|
||||
Alert,
|
||||
|
@@ -119,7 +119,7 @@ class Modal {
|
||||
relatedTarget
|
||||
})
|
||||
|
||||
if (this._isShown || showEvent.isDefaultPrevented()) {
|
||||
if (this._isShown || showEvent.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ class Modal {
|
||||
|
||||
const hideEvent = EventHandler.trigger(this._element, Event.HIDE)
|
||||
|
||||
if (!this._isShown || hideEvent.isDefaultPrevented()) {
|
||||
if (!this._isShown || hideEvent.defaultPrevented) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -282,16 +282,14 @@ class Modal {
|
||||
}
|
||||
|
||||
_enforceFocus() {
|
||||
if (this._isShown && this._config.keyboard) {
|
||||
EventHandler.on(this._element, Event.KEYDOWN_DISMISS, (event) => {
|
||||
if (event.which === ESCAPE_KEYCODE) {
|
||||
event.preventDefault()
|
||||
this.hide()
|
||||
}
|
||||
})
|
||||
} else if (!this._isShown) {
|
||||
EventHandler.off(this._element, Event.KEYDOWN_DISMISS)
|
||||
}
|
||||
EventHandler.off(document, Event.FOCUSIN) // guard against infinite focus loop
|
||||
EventHandler.on(document, Event.FOCUSIN, (event) => {
|
||||
if (document !== event.target &&
|
||||
this._element !== event.target &&
|
||||
!this._element.contains(event.target)) {
|
||||
this._element.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
_setEscapeEvent() {
|
||||
@@ -383,7 +381,7 @@ class Modal {
|
||||
const backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop)
|
||||
|
||||
EventHandler.one(this._backdrop, Util.TRANSITION_END, callback)
|
||||
Util.emulateTransitionEnd(backdropTransitionDuration)
|
||||
Util.emulateTransitionEnd(this._backdrop, backdropTransitionDuration)
|
||||
} else if (!this._isShown && this._backdrop) {
|
||||
this._backdrop.classList.remove(ClassName.SHOW)
|
||||
|
||||
|
@@ -682,8 +682,7 @@ class Tooltip {
|
||||
}
|
||||
})
|
||||
|
||||
if (typeof config !== 'undefined' &&
|
||||
typeof config.container === 'object' && config.container.jquery) {
|
||||
if (config && typeof config.container === 'object' && config.container.jquery) {
|
||||
config.container = config.container[0]
|
||||
}
|
||||
|
||||
|
@@ -5,8 +5,6 @@
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import EventHandler from './dom/eventHandler'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Private TransitionEnd Helpers
|
||||
|
Reference in New Issue
Block a user