use classList add/remove instead of edit className with string functions

This commit is contained in:
Phil Bolduc
2021-10-03 15:41:50 -07:00
parent f40398bf42
commit 8cc2ba4770
7 changed files with 1187 additions and 1188 deletions

View File

@@ -61,10 +61,10 @@
{
var x = gId("toast");
x.innerHTML = text;
x.className = error ? "error":"show";
x.classList.add(error ? "error":"show");
clearTimeout(timeout);
x.style.animation = 'none';
timeout = setTimeout(function(){ x.className = x.className.replace("show", ""); }, 2900);
timeout = setTimeout(function(){ x.classList.remove("show"); }, 2900);
}
function addRec(s, path = "", label = null)
{