mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +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 color = getPlatformColor(user.color, false)
|
||||||
|
|
||||||
const cursor = document.createElement('span')
|
const cursor = document.createElement('span')
|
||||||
|
cursor.classList.add('collaboration-cursor')
|
||||||
cursor.classList.add('collaboration-cursor__caret')
|
|
||||||
cursor.setAttribute('style', `border-color: ${color}`)
|
cursor.setAttribute('style', `border-color: ${color}`)
|
||||||
|
|
||||||
cursor.addEventListener('mousemove', () => {
|
const caret = document.createElement('div')
|
||||||
showTooltip(undefined, cursor, 'top', CollaborationUserPopup, { user })
|
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
|
return cursor
|
||||||
|
@ -145,13 +145,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Give a remote user a caret */
|
/* Give a remote user a caret */
|
||||||
.collaboration-cursor__caret {
|
.collaboration-cursor {
|
||||||
border-left: 1px solid transparent;
|
border-left: 1px solid transparent;
|
||||||
border-right: 1px solid transparent;
|
border-right: 1px solid transparent;
|
||||||
margin-left: -1px;
|
margin-left: -1px;
|
||||||
margin-right: -1px;
|
margin-right: -1px;
|
||||||
position: relative;
|
position: relative;
|
||||||
word-break: normal;
|
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 {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
@ -160,8 +172,6 @@
|
|||||||
border-style: solid;
|
border-style: solid;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
top: -2px;
|
|
||||||
left: -4px;
|
|
||||||
border-left: 4px solid transparent;
|
border-left: 4px solid transparent;
|
||||||
border-right: 4px solid transparent;
|
border-right: 4px solid transparent;
|
||||||
border-top-width: 4px;
|
border-top-width: 4px;
|
||||||
|
Loading…
Reference in New Issue
Block a user