Rebuild panel navigation

This commit is contained in:
2024-02-06 21:22:36 +01:00
parent b6fc305111
commit cab899e544
11 changed files with 800 additions and 713 deletions
+14
View File
@@ -66,3 +66,17 @@ export function copyTextToClipboard(text) {
}
);
}
export function getOuterWidth(element) {
var style = getComputedStyle(element);
var width = element.offsetWidth; // Width without padding and border
width += parseInt(style.marginLeft) + parseInt(style.marginRight); // Add margins
// Check if the box-sizing is border-box (includes padding and border in the width)
if (style.boxSizing === 'border-box') {
width += parseInt(style.paddingLeft) + parseInt(style.paddingRight); // Add padding
width += parseInt(style.borderLeftWidth) + parseInt(style.borderRightWidth); // Add border
}
return width;
}