chore: Fix bindFunctions type

This commit is contained in:
Sidharth Vinod 2023-11-27 23:10:36 +05:30
parent e7f7b6ad68
commit aff69e583e
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -32,7 +32,7 @@ let direction: string;
let version: string; // As in graph let version: string; // As in graph
// Functions to be run after graph rendering // Functions to be run after graph rendering
let funs: ((element: HTMLElement) => void)[] = []; let funs: ((element: Element) => void)[] = [];
const sanitizeText = (txt: string) => common.sanitizeText(txt, config); const sanitizeText = (txt: string) => common.sanitizeText(txt, config);
@ -362,7 +362,7 @@ export const setClickEvent = function (ids: string, functionName: string, functi
setClass(ids, 'clickable'); setClass(ids, 'clickable');
}; };
export const bindFunctions = function (element: HTMLElement) { export const bindFunctions = function (element: Element) {
funs.forEach(function (fun) { funs.forEach(function (fun) {
fun(element); fun(element);
}); });
@ -394,7 +394,7 @@ export const getClasses = function () {
return classes; return classes;
}; };
const setupToolTips = function (element: HTMLElement) { const setupToolTips = function (element: Element) {
let tooltipElem = select('.mermaidTooltip'); let tooltipElem = select('.mermaidTooltip');
// @ts-ignore TODO: fix this // @ts-ignore TODO: fix this
if ((tooltipElem._groups || tooltipElem)[0][0] === null) { if ((tooltipElem._groups || tooltipElem)[0][0] === null) {