Commit 2382549
committed
refactor: reuse getClosestTranscriptAncestor in getTranscriptContextMenuLink
The new getTranscriptContextMenuLink helper (from #3188) duplicated the
null/contains guard pattern that getClosestTranscriptAncestor — already
defined in the same file — performs. Delegate to the shared helper so
the target-element and anchor-ancestor checks stay in one place.
Behavior-preserving: getClosestTranscriptAncestor returns null for a
null/outside-root element, otherwise element.closest(selector), then
null again if the ancestor is outside the transcript root — identical
to the original inline guards. All 22 transcriptContextMenu tests
continue to pass.1 parent c1a6bc6 commit 2382549
1 file changed
Lines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
| |||
0 commit comments