MCPcopy
hub / github.com/marktext/marktext / outHandler

Function outHandler

packages/muya/src/editor/linkMouseEvents.ts:97–113  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

95 };
96
97 const outHandler = (event: Event) => {
98 const wrapper = findLinkWrapper(event.target);
99 if (!wrapper)
100 return;
101
102 // Ignore mouseout when the pointer is still inside the same wrapper
103 // (e.g. crossing between a `<strong>` and the surrounding text child).
104 // Without this guard the popover hides every time the pointer crosses
105 // an internal element boundary.
106 if (event instanceof MouseEvent) {
107 const { relatedTarget } = event;
108 if (relatedTarget instanceof Node && wrapper.contains(relatedTarget))
109 return;
110 }
111
112 eventCenter.emit('muya-link-tools', { reference: null });
113 };
114
115 const clickHandler = (event: Event) => {
116 if (!(event.target instanceof HTMLElement))

Callers

nothing calls this directly

Calls 3

findLinkWrapperFunction · 0.85
containsMethod · 0.80
emitMethod · 0.80

Tested by

no test coverage detected