mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 18:58:35 +08:00
10 lines
336 B
TypeScript
10 lines
336 B
TypeScript
export const getHoveredParallelId = (relatedTarget: EventTarget | null) => {
|
|
const element = relatedTarget as Element | null
|
|
if (element && 'closest' in element) {
|
|
const closestParallel = element.closest('[data-parallel-id]')
|
|
if (closestParallel) return closestParallel.getAttribute('data-parallel-id')
|
|
}
|
|
|
|
return null
|
|
}
|