Set max width to window width if it does not exceed

This commit is contained in:
Kenox 2022-11-04 09:18:38 +01:00
commit ec3d0d2675
2 changed files with 5 additions and 1 deletions

View file

@ -328,6 +328,10 @@ function highlightNew(code) {
} }
codes[i].style.removeProperty("background-color"); codes[i].style.removeProperty("background-color");
} }
const windowWidth = $(window).width();
if(windowWidth > maxWidth)
maxWidth = windowWidth;
for (let i = 0; i < codes.length; i++) { for (let i = 0; i < codes.length; i++) {
codes[i].style.width = maxWidth + 'px'; codes[i].style.width = maxWidth + 'px';
} }

File diff suppressed because one or more lines are too long