Commit 26770fae authored by mgabdev's avatar mgabdev

Updated UserInfoPopover display delay in Avatar, DisplayName

• Updated:
- UserInfoPopover display delay in Avatar, DisplayName to 1250ms
parent e7dc3c47
......@@ -72,7 +72,7 @@ class Avatar extends ImmutablePureComponent {
accountId: this.props.account.get('id'),
})
document.addEventListener('mousemove', this.handleMouseMove, true)
}, 650)
}, 1250)
}
handleMouseLeave = debounce((e) => {
......@@ -82,19 +82,19 @@ class Avatar extends ImmutablePureComponent {
handleMouseMove = debounce((e) => {
this.attemptToHidePopover(e)
}, 150)
}, 100)
attemptToHidePopover = (e) => {
const lastTarget = e.toElement || e.relatedTarget
if (!(lastTarget instanceof Element || lastTarget instanceof HTMLDocument)) return
const isElement = (lastTarget instanceof Element || lastTarget instanceof HTMLDocument)
const userInfoPopoverEl = document.getElementById('user-info-popover')
if (this.mouseOverTimeout &&
!this.props.noHover &&
(
(userInfoPopoverEl && lastTarget && !userInfoPopoverEl.contains(lastTarget)) ||
(!userInfoPopoverEl && lastTarget && this.node && !this.node.contains(lastTarget))
!isElement && !userInfoPopoverEl ||
(userInfoPopoverEl && isElement && lastTarget && !userInfoPopoverEl.contains(lastTarget)) ||
(!userInfoPopoverEl && isElement && lastTarget && this.node && !this.node.contains(lastTarget))
)) {
document.removeEventListener('mousemove', this.handleMouseMove, true)
clearTimeout(this.mouseOverTimeout)
......
......@@ -65,7 +65,7 @@ class DisplayName extends ImmutablePureComponent {
accountId: this.props.account.get('id'),
})
document.addEventListener('mousemove', this.handleMouseMove, true)
}, 650)
}, 1250)
}
handleMouseLeave = debounce((e) => {
......@@ -74,18 +74,18 @@ class DisplayName extends ImmutablePureComponent {
handleMouseMove = debounce((e) => {
this.attemptToHidePopover(e)
}, 150)
}, 100)
attemptToHidePopover = (e) => {
const lastTarget = e.toElement || e.relatedTarget
if (!(lastTarget instanceof Element || lastTarget instanceof HTMLDocument)) return
const isElement = (lastTarget instanceof Element || lastTarget instanceof HTMLDocument)
const userInfoPopoverEl = document.getElementById('user-info-popover')
if (this.mouseOverTimeout &&
(
(userInfoPopoverEl && lastTarget && !userInfoPopoverEl.contains(lastTarget)) ||
(!userInfoPopoverEl && lastTarget && this.node && !this.node.contains(lastTarget))
!isElement && !userInfoPopoverEl ||
(userInfoPopoverEl && isElement && lastTarget && !userInfoPopoverEl.contains(lastTarget)) ||
(!userInfoPopoverEl && isElement && lastTarget && this.node && !this.node.contains(lastTarget))
)) {
document.removeEventListener('mousemove', this.handleMouseMove, true)
clearTimeout(this.mouseOverTimeout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment