mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
ui-toast: hide countdown if infinite
This commit is contained in:
parent
48147c079e
commit
22dfc6ec24
|
@ -73,8 +73,8 @@ html {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
right: 1%;
|
right: 1px;
|
||||||
width: 99%;
|
left: 1px;
|
||||||
animation: toastt var(--tmtime) steps(var(--tmstep)) forwards;
|
animation: toastt var(--tmtime) steps(var(--tmstep)) forwards;
|
||||||
transform-origin: right;
|
transform-origin: right;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1527,21 +1527,26 @@ var toast = (function () {
|
||||||
if (sec)
|
if (sec)
|
||||||
te = setTimeout(r.hide, sec * 1000);
|
te = setTimeout(r.hide, sec * 1000);
|
||||||
|
|
||||||
|
if (same && delta < 1000) {
|
||||||
var tb = ebi('toastt');
|
var tb = ebi('toastt');
|
||||||
if (same && delta < 1000 && tb) {
|
if (tb) {
|
||||||
tb.style.animation = 'none';
|
tb.style.animation = 'none';
|
||||||
tb.offsetHeight;
|
tb.offsetHeight;
|
||||||
tb.style.animation = null;
|
tb.style.animation = null;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txt.indexOf('<body>') + 1)
|
if (txt.indexOf('<body>') + 1)
|
||||||
txt = txt.slice(0, txt.indexOf('<')) + ' [...]';
|
txt = txt.slice(0, txt.indexOf('<')) + ' [...]';
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
if (sec) {
|
||||||
setcvar('--tmtime', sec + 's');
|
setcvar('--tmtime', sec + 's');
|
||||||
setcvar('--tmstep', sec * 15);
|
setcvar('--tmstep', sec * 15);
|
||||||
|
html += '<div id="toastt"></div>';
|
||||||
obj.innerHTML = '<div id="toastt"></div><a href="#" id="toastc">x</a><div id="toastb">' + lf2br(txt) + '</div>';
|
}
|
||||||
|
obj.innerHTML = html + '<a href="#" id="toastc">x</a><div id="toastb">' + lf2br(txt) + '</div>';
|
||||||
obj.className = cl;
|
obj.className = cl;
|
||||||
sec += obj.offsetWidth;
|
sec += obj.offsetWidth;
|
||||||
obj.className += ' vis';
|
obj.className += ' vis';
|
||||||
|
|
Loading…
Reference in a new issue