Avoid using Array.includes()

Internet Explorer doesn't have this method. Use the safer indexOf()
instead.
This commit is contained in:
Pierre Ossman 2019-12-23 15:11:32 +01:00
parent 2cf82a5c8e
commit b8d1a8bb57
1 changed files with 2 additions and 2 deletions

View File

@ -1152,12 +1152,12 @@ const UI = {
document.getElementById("noVNC_password_block").classList.remove("noVNC_hidden");
let inputFocus = "none";
if (!e.detail.types.includes("username")) {
if (e.detail.types.indexOf("username") === -1) {
document.getElementById("noVNC_username_block").classList.add("noVNC_hidden");
} else {
inputFocus = inputFocus === "none" ? "noVNC_username_input" : inputFocus;
}
if (!e.detail.types.includes("password")) {
if (e.detail.types.indexOf("password") === -1) {
document.getElementById("noVNC_password_block").classList.add("noVNC_hidden");
} else {
inputFocus = inputFocus === "none" ? "noVNC_password_input" : inputFocus;