Compare commits
3 commits
main
...
main-xmr-m
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
88783b3f82 | ||
|
|
70bba97f6c | ||
|
|
88286fef6e |
4 changed files with 22 additions and 14 deletions
|
|
@ -12,6 +12,7 @@ import {
|
||||||
getElementFromSelector,
|
getElementFromSelector,
|
||||||
getTransitionDurationFromElement,
|
getTransitionDurationFromElement,
|
||||||
isVisible,
|
isVisible,
|
||||||
|
isTouchEnabledDevice,
|
||||||
reflow,
|
reflow,
|
||||||
triggerTransitionEnd,
|
triggerTransitionEnd,
|
||||||
typeCheckConfig
|
typeCheckConfig
|
||||||
|
|
@ -118,7 +119,7 @@ class Carousel extends BaseComponent {
|
||||||
|
|
||||||
this._config = this._getConfig(config)
|
this._config = this._getConfig(config)
|
||||||
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)
|
this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)
|
||||||
this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0
|
this._touchSupported = isTouchEnabledDevice() || navigator.maxTouchPoints > 0
|
||||||
this._pointerEvent = Boolean(window.PointerEvent)
|
this._pointerEvent = Boolean(window.PointerEvent)
|
||||||
|
|
||||||
this._addEventListeners()
|
this._addEventListeners()
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import {
|
||||||
isElement,
|
isElement,
|
||||||
isVisible,
|
isVisible,
|
||||||
isRTL,
|
isRTL,
|
||||||
|
isTouchEnabledDevice,
|
||||||
noop,
|
noop,
|
||||||
typeCheckConfig
|
typeCheckConfig
|
||||||
} from './util/index'
|
} from './util/index'
|
||||||
|
|
@ -181,10 +182,10 @@ class Dropdown extends BaseComponent {
|
||||||
// empty mouseover listeners to the body's immediate children;
|
// empty mouseover listeners to the body's immediate children;
|
||||||
// only needed because of broken event delegation on iOS
|
// only needed because of broken event delegation on iOS
|
||||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||||
if ('ontouchstart' in document.documentElement &&
|
if (isTouchEnabledDevice() && !parent.closest(SELECTOR_NAVBAR_NAV)) {
|
||||||
!parent.closest(SELECTOR_NAVBAR_NAV)) {
|
[].concat(...document.body.children).forEach(element => {
|
||||||
[].concat(...document.body.children)
|
EventHandler.on(element, 'mouseover', null, noop)
|
||||||
.forEach(elem => EventHandler.on(elem, 'mouseover', null, noop()))
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this._element.focus()
|
this._element.focus()
|
||||||
|
|
@ -381,9 +382,10 @@ class Dropdown extends BaseComponent {
|
||||||
|
|
||||||
// If this is a touch-enabled device we remove the extra
|
// If this is a touch-enabled device we remove the extra
|
||||||
// empty mouseover listeners we added for iOS support
|
// empty mouseover listeners we added for iOS support
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if (isTouchEnabledDevice()) {
|
||||||
[].concat(...document.body.children)
|
[].concat(...document.body.children).forEach(element => {
|
||||||
.forEach(elem => EventHandler.off(elem, 'mouseover', null, noop()))
|
EventHandler.off(element, 'mouseover', null, noop)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
toggles[i].setAttribute('aria-expanded', 'false')
|
toggles[i].setAttribute('aria-expanded', 'false')
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import {
|
||||||
getUID,
|
getUID,
|
||||||
isElement,
|
isElement,
|
||||||
isRTL,
|
isRTL,
|
||||||
|
isTouchEnabledDevice,
|
||||||
noop,
|
noop,
|
||||||
typeCheckConfig
|
typeCheckConfig
|
||||||
} from './util/index'
|
} from './util/index'
|
||||||
|
|
@ -298,9 +299,9 @@ class Tooltip extends BaseComponent {
|
||||||
// empty mouseover listeners to the body's immediate children;
|
// empty mouseover listeners to the body's immediate children;
|
||||||
// only needed because of broken event delegation on iOS
|
// only needed because of broken event delegation on iOS
|
||||||
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if (isTouchEnabledDevice()) {
|
||||||
[].concat(...document.body.children).forEach(element => {
|
[].concat(...document.body.children).forEach(element => {
|
||||||
EventHandler.on(element, 'mouseover', noop())
|
EventHandler.on(element, 'mouseover', noop)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -355,9 +356,10 @@ class Tooltip extends BaseComponent {
|
||||||
|
|
||||||
// If this is a touch-enabled device we remove the extra
|
// If this is a touch-enabled device we remove the extra
|
||||||
// empty mouseover listeners we added for iOS support
|
// empty mouseover listeners we added for iOS support
|
||||||
if ('ontouchstart' in document.documentElement) {
|
if (isTouchEnabledDevice()) {
|
||||||
[].concat(...document.body.children)
|
[].concat(...document.body.children).forEach(element => {
|
||||||
.forEach(element => EventHandler.off(element, 'mouseover', noop))
|
EventHandler.off(element, 'mouseover', noop)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this._activeTrigger[TRIGGER_CLICK] = false
|
this._activeTrigger[TRIGGER_CLICK] = false
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,8 @@ const defineJQueryPlugin = (name, plugin) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isTouchEnabledDevice = () => 'ontouchstart' in document.documentElement
|
||||||
|
|
||||||
export {
|
export {
|
||||||
TRANSITION_END,
|
TRANSITION_END,
|
||||||
getUID,
|
getUID,
|
||||||
|
|
@ -221,5 +223,6 @@ export {
|
||||||
getjQuery,
|
getjQuery,
|
||||||
onDOMContentLoaded,
|
onDOMContentLoaded,
|
||||||
isRTL,
|
isRTL,
|
||||||
defineJQueryPlugin
|
defineJQueryPlugin,
|
||||||
|
isTouchEnabledDevice
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue