From 6d1d3e48d80af2b6099761924d2c1429fe0baadd Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 31 Jan 2023 17:54:04 +0000 Subject: [PATCH] sandbox height didnt account for scrollbars --- copyparty/web/browser.css | 5 +++-- copyparty/web/browser.js | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 40054394..6d73c4bd 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -835,8 +835,9 @@ html.y #path a:hover { .mdo { max-width: 52em; } -.mdo.sb { - max-width: unset; +.mdo.sb, +#epi.logue.mdo>iframe { + max-width: 54em; } .mdo, .mdo * { diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 045c0e26..5d418a88 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1200,6 +1200,17 @@ function goto(dest) { } +var SBW, SBH; // scrollbar size +(function () { + var el = mknod('div'); + el.style.cssText = 'overflow:scroll;width:100px;height:100px'; + document.body.appendChild(el); + SBW = el.offsetWidth - el.clientWidth; + SBH = el.offsetHeight - el.clientHeight; + document.body.removeChild(el); +})(); + + var have_webp = sread('have_webp'); (function () { if (have_webp !== null) @@ -6762,7 +6773,7 @@ function sandbox(tgt, rules, cls, html) { html = '' + html + '' + sandboxjs() + - '