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

Function addTooltip

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

Source from the content-addressed store, hash-verified

98@example addTooltip('Does something', $('.some-existing-button'))
99*/
100export default function addTooltip(
101 content: string | TooltipOptions,
102 element: Element,
103): void {
104 if (!element.parentElement) {
105 throw new Error('Element has no parent. Use `tooltipped` instead for elements not yet attached to a parent.');
106 }
107
108 const tooltip = createTooltipFor(element, content);
109 // Attach to element first just in case the global container is missing. This also "activates" the tool-tip element.
110 element.append(tooltip);
111 attachToDocument(tooltip);
112}

Callers 2

updateStatusBadgesFunction · 0.85
addButtonFunction · 0.85

Calls 3

createTooltipForFunction · 0.85
attachToDocumentFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected