MCPcopy Index your code
hub / github.com/refined-github/refined-github / tooltipped

Function tooltipped

source/helpers/tooltip.tsx:76–93  ·  view source on GitHub ↗
(
	content: string | TooltipOptions,
	element: Element,
)

Source from the content-addressed store, hash-verified

74@example return <div>{tooltipped('Does something', <button type="button">...</button>)}</div>;
75*/
76export function tooltipped(
77 content: string | TooltipOptions,
78 element: Element,
79): Element {
80 const tooltip = createTooltipFor(element, content);
81 element.append(tooltip);
82
83 queueMicrotask(() => {
84 // TODO: Replace with https://github.com/sindresorhus/ts-extras/issues/75
85 if (!element.isConnected) {
86 throw new Error('Element must be attached to the document before the tooltip');
87 }
88
89 attachToDocument(tooltip);
90 });
91
92 return element;
93}
94
95/**
96Attaches a tooltip to an existing element. Don't use this with JSX.

Callers 15

addIconFunction · 0.85
attachButtonsFunction · 0.85
initFunction · 0.85
addIndicatorsFunction · 0.85
addSidebarReviewButtonsFunction · 0.85
initFunction · 0.85
highlightBestCommentFunction · 0.85
addButtonFunction · 0.85
addFunction · 0.85
addQuickEditButtonFunction · 0.85

Calls 3

createTooltipForFunction · 0.85
attachToDocumentFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected