2025-12-23 20:18:27 +00:00
|
|
|
import { setIcon } from "obsidian";
|
|
|
|
|
|
2025-12-20 01:34:41 +00:00
|
|
|
export function getOuterHeight(element: HTMLElement): number {
|
|
|
|
|
const marginTop = parseFloat(getComputedStyle(element).marginTop) || 0;
|
|
|
|
|
const marginBottom = parseFloat(getComputedStyle(element).marginBottom) || 0;
|
|
|
|
|
return element.offsetHeight + marginTop + marginBottom;
|
2025-12-23 20:18:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function setElementIcon(element: HTMLDivElement, iconName: string) {
|
|
|
|
|
if (element) {
|
|
|
|
|
setIcon(element, iconName);
|
|
|
|
|
}
|
|
|
|
|
return {
|
|
|
|
|
update(newIconName: string) {
|
|
|
|
|
if (element) {
|
|
|
|
|
setIcon(element, newIconName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-12-20 01:34:41 +00:00
|
|
|
}
|