mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
Unbreak lines.
This commit is contained in:
parent
91c11d6465
commit
f15af45c6e
@ -144,8 +144,7 @@ class Alert {
|
||||
* Data Api implementation
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
EventHandler
|
||||
.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()))
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()))
|
||||
|
||||
const $ = getjQuery()
|
||||
|
||||
|
@ -263,15 +263,12 @@ class Carousel {
|
||||
|
||||
_addEventListeners() {
|
||||
if (this._config.keyboard) {
|
||||
EventHandler
|
||||
.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))
|
||||
EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))
|
||||
}
|
||||
|
||||
if (this._config.pause === 'hover') {
|
||||
EventHandler
|
||||
.on(this._element, EVENT_MOUSEENTER, event => this.pause(event))
|
||||
EventHandler
|
||||
.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event))
|
||||
EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event))
|
||||
EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event))
|
||||
}
|
||||
|
||||
if (this._config.touch && this._touchSupported) {
|
||||
@ -476,24 +473,23 @@ class Carousel {
|
||||
|
||||
const transitionDuration = getTransitionDurationFromElement(activeElement)
|
||||
|
||||
EventHandler
|
||||
.one(activeElement, TRANSITION_END, () => {
|
||||
nextElement.classList.remove(directionalClassName, orderClassName)
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE)
|
||||
EventHandler.one(activeElement, TRANSITION_END, () => {
|
||||
nextElement.classList.remove(directionalClassName, orderClassName)
|
||||
nextElement.classList.add(CLASS_NAME_ACTIVE)
|
||||
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)
|
||||
activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)
|
||||
|
||||
this._isSliding = false
|
||||
this._isSliding = false
|
||||
|
||||
setTimeout(() => {
|
||||
EventHandler.trigger(this._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
to: nextElementIndex
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
setTimeout(() => {
|
||||
EventHandler.trigger(this._element, EVENT_SLID, {
|
||||
relatedTarget: nextElement,
|
||||
direction: eventDirectionName,
|
||||
from: activeElementIndex,
|
||||
to: nextElementIndex
|
||||
})
|
||||
}, 0)
|
||||
})
|
||||
|
||||
emulateTransitionEnd(activeElement, transitionDuration)
|
||||
} else {
|
||||
@ -593,8 +589,7 @@ class Carousel {
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
EventHandler
|
||||
.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler)
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler)
|
||||
|
||||
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
|
||||
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
|
||||
|
@ -95,6 +95,7 @@ function getEvent(element) {
|
||||
function bootstrapHandler(element, fn) {
|
||||
return function handler(event) {
|
||||
event.delegateTarget = element
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn)
|
||||
}
|
||||
@ -111,6 +112,7 @@ function bootstrapDelegationHandler(element, selector, fn) {
|
||||
for (let i = domElements.length; i--;) {
|
||||
if (domElements[i] === target) {
|
||||
event.delegateTarget = target
|
||||
|
||||
if (handler.oneOff) {
|
||||
EventHandler.off(element, event.type, fn)
|
||||
}
|
||||
|
@ -468,8 +468,7 @@ class Dropdown {
|
||||
return
|
||||
}
|
||||
|
||||
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent)
|
||||
.filter(isVisible)
|
||||
const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent).filter(isVisible)
|
||||
|
||||
if (!items.length) {
|
||||
return
|
||||
@ -511,8 +510,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
|
||||
event.stopPropagation()
|
||||
Dropdown.dropdownInterface(this, 'toggle')
|
||||
})
|
||||
EventHandler
|
||||
.on(document, EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, e => e.stopPropagation())
|
||||
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_FORM_CHILD, e => e.stopPropagation())
|
||||
|
||||
const $ = getjQuery()
|
||||
|
||||
|
@ -118,27 +118,26 @@ class ScrollSpy {
|
||||
|
||||
const targets = SelectorEngine.find(this._selector)
|
||||
|
||||
targets
|
||||
.map(element => {
|
||||
let target
|
||||
const targetSelector = getSelectorFromElement(element)
|
||||
targets.map(element => {
|
||||
let target
|
||||
const targetSelector = getSelectorFromElement(element)
|
||||
|
||||
if (targetSelector) {
|
||||
target = SelectorEngine.findOne(targetSelector)
|
||||
if (targetSelector) {
|
||||
target = SelectorEngine.findOne(targetSelector)
|
||||
}
|
||||
|
||||
if (target) {
|
||||
const targetBCR = target.getBoundingClientRect()
|
||||
if (targetBCR.width || targetBCR.height) {
|
||||
return [
|
||||
Manipulator[offsetMethod](target).top + offsetBase,
|
||||
targetSelector
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (target) {
|
||||
const targetBCR = target.getBoundingClientRect()
|
||||
if (targetBCR.width || targetBCR.height) {
|
||||
return [
|
||||
Manipulator[offsetMethod](target).top + offsetBase,
|
||||
targetSelector
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
})
|
||||
return null
|
||||
})
|
||||
.filter(item => item)
|
||||
.sort((a, b) => a[0] - b[0])
|
||||
.forEach(item => {
|
||||
@ -253,8 +252,7 @@ class ScrollSpy {
|
||||
const link = SelectorEngine.findOne(queries.join(','))
|
||||
|
||||
if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
|
||||
SelectorEngine
|
||||
.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
|
||||
SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))
|
||||
.classList.add(CLASS_NAME_ACTIVE)
|
||||
|
||||
link.classList.add(CLASS_NAME_ACTIVE)
|
||||
@ -262,8 +260,7 @@ class ScrollSpy {
|
||||
// Set triggered link as active
|
||||
link.classList.add(CLASS_NAME_ACTIVE)
|
||||
|
||||
SelectorEngine
|
||||
.parents(link, SELECTOR_NAV_LIST_GROUP)
|
||||
SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP)
|
||||
.forEach(listGroup => {
|
||||
// Set triggered links parents as active
|
||||
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
|
||||
|
@ -179,12 +179,7 @@ class Toast {
|
||||
}
|
||||
|
||||
_setListeners() {
|
||||
EventHandler.on(
|
||||
this._element,
|
||||
EVENT_CLICK_DISMISS,
|
||||
SELECTOR_DATA_DISMISS,
|
||||
() => this.hide()
|
||||
)
|
||||
EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, () => this.hide())
|
||||
}
|
||||
|
||||
_clearTimeout() {
|
||||
|
@ -676,12 +676,11 @@ class Tooltip {
|
||||
_getConfig(config) {
|
||||
const dataAttributes = Manipulator.getDataAttributes(this.element)
|
||||
|
||||
Object.keys(dataAttributes)
|
||||
.forEach(dataAttr => {
|
||||
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
||||
delete dataAttributes[dataAttr]
|
||||
}
|
||||
})
|
||||
Object.keys(dataAttributes).forEach(dataAttr => {
|
||||
if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
|
||||
delete dataAttributes[dataAttr]
|
||||
}
|
||||
})
|
||||
|
||||
if (config && typeof config.container === 'object' && config.container.jquery) {
|
||||
config.container = config.container[0]
|
||||
|
Loading…
Reference in New Issue
Block a user