Rebuild panel navigation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user