mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +03:00
Improved collaborative cursor hover experience (#5376)
Signed-off-by: Omkar Dange <aumkardange@gmail.com>
This commit is contained in:
parent
8e9b23747f
commit
0b3cd8162c
@ -22,12 +22,16 @@ export const renderCursor = (user: CollaborationUser): HTMLElement => {
|
||||
const color = getPlatformColor(user.color, false)
|
||||
|
||||
const cursor = document.createElement('span')
|
||||
|
||||
cursor.classList.add('collaboration-cursor__caret')
|
||||
cursor.classList.add('collaboration-cursor')
|
||||
cursor.setAttribute('style', `border-color: ${color}`)
|
||||
|
||||
cursor.addEventListener('mousemove', () => {
|
||||
showTooltip(undefined, cursor, 'top', CollaborationUserPopup, { user })
|
||||
const caret = document.createElement('div')
|
||||
caret.classList.add('collaboration-cursor__caret')
|
||||
caret.setAttribute('style', `border-color: ${color}`)
|
||||
cursor.appendChild(caret)
|
||||
|
||||
caret.addEventListener('mousemove', () => {
|
||||
showTooltip(undefined, caret, 'top', CollaborationUserPopup, { user })
|
||||
})
|
||||
|
||||
return cursor
|
||||
|
@ -145,13 +145,25 @@
|
||||
}
|
||||
|
||||
/* Give a remote user a caret */
|
||||
.collaboration-cursor__caret {
|
||||
.collaboration-cursor {
|
||||
border-left: 1px solid transparent;
|
||||
border-right: 1px solid transparent;
|
||||
margin-left: -1px;
|
||||
margin-right: -1px;
|
||||
position: relative;
|
||||
word-break: normal;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.collaboration-cursor__caret {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
cursor: text;
|
||||
height: 110%;
|
||||
width: 8px;
|
||||
top: -2px;
|
||||
left: -4px;
|
||||
position: absolute;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
@ -160,8 +172,6 @@
|
||||
border-style: solid;
|
||||
width: 0;
|
||||
height: 0;
|
||||
top: -2px;
|
||||
left: -4px;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top-width: 4px;
|
||||
|
Loading…
Reference in New Issue
Block a user