diff --git a/copyparty/web/ui.css b/copyparty/web/ui.css index f920153e..a66bb77e 100644 --- a/copyparty/web/ui.css +++ b/copyparty/web/ui.css @@ -73,8 +73,8 @@ html { position: absolute; height: 1px; top: 1px; - right: 1%; - width: 99%; + right: 1px; + left: 1px; animation: toastt var(--tmtime) steps(var(--tmstep)) forwards; transform-origin: right; } diff --git a/copyparty/web/util.js b/copyparty/web/util.js index 365bffa4..3b235f02 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -1527,21 +1527,26 @@ var toast = (function () { if (sec) te = setTimeout(r.hide, sec * 1000); - var tb = ebi('toastt'); - if (same && delta < 1000 && tb) { - tb.style.animation = 'none'; - tb.offsetHeight; - tb.style.animation = null; + if (same && delta < 1000) { + var tb = ebi('toastt'); + if (tb) { + tb.style.animation = 'none'; + tb.offsetHeight; + tb.style.animation = null; + } return; } if (txt.indexOf('') + 1) txt = txt.slice(0, txt.indexOf('<')) + ' [...]'; - setcvar('--tmtime', sec + 's'); - setcvar('--tmstep', sec * 15); - - obj.innerHTML = '
x
' + lf2br(txt) + '
'; + var html = ''; + if (sec) { + setcvar('--tmtime', sec + 's'); + setcvar('--tmstep', sec * 15); + html += '
'; + } + obj.innerHTML = html + 'x
' + lf2br(txt) + '
'; obj.className = cl; sec += obj.offsetWidth; obj.className += ' vis';