mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
11 lines
380 B
TypeScript
11 lines
380 B
TypeScript
/* eslint-disable import/prefer-default-export */
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
|
|
export const findParentElementByClassName = (element: any, parentClassName: string) => {
|
|
while (element) {
|
|
if (element.classList.contains(parentClassName)) return element;
|
|
element = element.parentElement;
|
|
}
|
|
return null;
|
|
};
|