From b6585dc186cf0805c5ba7afae4fefee3dd769d5e Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Thu, 7 Dec 2023 16:05:52 +0100 Subject: [PATCH 1/2] add margin-right to prevent scrollbar from overlaying table --- cis/private/tools/zeitaufzeichnung.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php index 0eb86bdb1..7937857ef 100644 --- a/cis/private/tools/zeitaufzeichnung.php +++ b/cis/private/tools/zeitaufzeichnung.php @@ -229,6 +229,21 @@ $( document ).ready(function() '; +echo << + $(document).ready(function() { + const scrollDiv = document.createElement('div'); + scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; + document.body.appendChild(scrollDiv); + const scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; + document.body.removeChild(scrollDiv); + var marginright = Math.max((20 - scrollbarWidth), 0); + document.body.style.setProperty('width', 'calc(100% - ' + marginright + 'px)'); + }); + + +EOSBJS; + echo '