add margin-right to prevent scrollbar from overlaying table

This commit is contained in:
Harald Bamberger
2023-12-07 16:05:52 +01:00
parent 483b6171c7
commit b6585dc186
+16 -1
View File
@@ -229,6 +229,21 @@ $( document ).ready(function()
</script>
';
echo <<<EOSBJS
<script>
$(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)');
});
</script>
EOSBJS;
echo '
<script type="text/javascript">
$(document).ready(function()
@@ -1621,7 +1636,7 @@ if ($projekt->getProjekteMitarbeiter($user, true))
<td '.$style.' align="right"><b>'.$tagessaldo.$erstr.'</b><br>'.date('H:i', ($pausesumme-3600)).'</td>
<td '.$style.' colspan="3" align="right">';
if ($tag > $sperrdatum)
echo '<a href="?von_datum='.$datum->formatDatum($tag,'d.m.Y').'&bis_datum='.$datum->formatDatum($tag,'d.m.Y').'" class="item">&lt;-</a>';
echo '<a href="?von_datum='.$datum->formatDatum($tag,'d.m.Y').'&bis_datum='.$datum->formatDatum($tag,'d.m.Y').'" class="item">&larr;</a>';
echo '</td></tr>';