mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-07 04:54:24 +01:00
Unbreak short lines
This commit is contained in:
parent
9f9e4d04a1
commit
94a5d87e15
@ -100,8 +100,7 @@ class Alert {
|
|||||||
|
|
||||||
const transitionDuration = getTransitionDurationFromElement(element)
|
const transitionDuration = getTransitionDurationFromElement(element)
|
||||||
|
|
||||||
EventHandler
|
EventHandler.one(element, TRANSITION_END, () => this._destroyElement(element))
|
||||||
.one(element, TRANSITION_END, () => this._destroyElement(element))
|
|
||||||
emulateTransitionEnd(element, transitionDuration)
|
emulateTransitionEnd(element, transitionDuration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,14 +207,13 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector)
|
|||||||
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
function removeNamespacedHandlers(element, events, typeEvent, namespace) {
|
||||||
const storeElementEvent = events[typeEvent] || {}
|
const storeElementEvent = events[typeEvent] || {}
|
||||||
|
|
||||||
Object.keys(storeElementEvent)
|
Object.keys(storeElementEvent).forEach(handlerKey => {
|
||||||
.forEach(handlerKey => {
|
if (handlerKey.indexOf(namespace) > -1) {
|
||||||
if (handlerKey.indexOf(namespace) > -1) {
|
const event = storeElementEvent[handlerKey]
|
||||||
const event = storeElementEvent[handlerKey]
|
|
||||||
|
|
||||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const EventHandler = {
|
const EventHandler = {
|
||||||
@ -247,23 +246,21 @@ const EventHandler = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isNamespace) {
|
if (isNamespace) {
|
||||||
Object.keys(events)
|
Object.keys(events).forEach(elementEvent => {
|
||||||
.forEach(elementEvent => {
|
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))
|
||||||
removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const storeElementEvent = events[typeEvent] || {}
|
const storeElementEvent = events[typeEvent] || {}
|
||||||
Object.keys(storeElementEvent)
|
Object.keys(storeElementEvent).forEach(keyHandlers => {
|
||||||
.forEach(keyHandlers => {
|
const handlerKey = keyHandlers.replace(stripUidRegex, '')
|
||||||
const handlerKey = keyHandlers.replace(stripUidRegex, '')
|
|
||||||
|
|
||||||
if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
|
if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
|
||||||
const event = storeElementEvent[keyHandlers]
|
const event = storeElementEvent[keyHandlers]
|
||||||
|
|
||||||
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
trigger(element, event, args) {
|
trigger(element, event, args) {
|
||||||
@ -300,16 +297,15 @@ const EventHandler = {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// merge custom informations in our event
|
// merge custom information in our event
|
||||||
if (typeof args !== 'undefined') {
|
if (typeof args !== 'undefined') {
|
||||||
Object.keys(args)
|
Object.keys(args).forEach(key => {
|
||||||
.forEach(key => {
|
Object.defineProperty(evt, key, {
|
||||||
Object.defineProperty(evt, key, {
|
get() {
|
||||||
get() {
|
return args[key]
|
||||||
return args[key]
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultPrevented) {
|
if (defaultPrevented) {
|
||||||
|
@ -262,11 +262,7 @@ class Dropdown {
|
|||||||
...config
|
...config
|
||||||
}
|
}
|
||||||
|
|
||||||
typeCheckConfig(
|
typeCheckConfig(NAME, config, this.constructor.DefaultType)
|
||||||
NAME,
|
|
||||||
config,
|
|
||||||
this.constructor.DefaultType
|
|
||||||
)
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
@ -172,11 +172,7 @@ class Toast {
|
|||||||
...typeof config === 'object' && config ? config : {}
|
...typeof config === 'object' && config ? config : {}
|
||||||
}
|
}
|
||||||
|
|
||||||
typeCheckConfig(
|
typeCheckConfig(NAME, config, this.constructor.DefaultType)
|
||||||
NAME,
|
|
||||||
config,
|
|
||||||
this.constructor.DefaultType
|
|
||||||
)
|
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
@ -708,11 +708,7 @@ class Tooltip {
|
|||||||
config.content = config.content.toString()
|
config.content = config.content.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
typeCheckConfig(
|
typeCheckConfig(NAME, config, this.constructor.DefaultType)
|
||||||
NAME,
|
|
||||||
config,
|
|
||||||
this.constructor.DefaultType
|
|
||||||
)
|
|
||||||
|
|
||||||
if (config.sanitize) {
|
if (config.sanitize) {
|
||||||
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)
|
config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)
|
||||||
|
@ -110,21 +110,20 @@ const emulateTransitionEnd = (element, duration) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const typeCheckConfig = (componentName, config, configTypes) => {
|
const typeCheckConfig = (componentName, config, configTypes) => {
|
||||||
Object.keys(configTypes)
|
Object.keys(configTypes).forEach(property => {
|
||||||
.forEach(property => {
|
const expectedTypes = configTypes[property]
|
||||||
const expectedTypes = configTypes[property]
|
const value = config[property]
|
||||||
const value = config[property]
|
const valueType = value && isElement(value) ?
|
||||||
const valueType = value && isElement(value) ?
|
'element' :
|
||||||
'element' :
|
toType(value)
|
||||||
toType(value)
|
|
||||||
|
|
||||||
if (!new RegExp(expectedTypes).test(valueType)) {
|
if (!new RegExp(expectedTypes).test(valueType)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`${componentName.toUpperCase()}: ` +
|
`${componentName.toUpperCase()}: ` +
|
||||||
`Option "${property}" provided type "${valueType}" ` +
|
`Option "${property}" provided type "${valueType}" ` +
|
||||||
`but expected type "${expectedTypes}".`)
|
`but expected type "${expectedTypes}".`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const isVisible = element => {
|
const isVisible = element => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user