]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Avoid using Array.includes()
authorPierre Ossman <ossman@cendio.se>
Mon, 23 Dec 2019 14:11:32 +0000 (15:11 +0100)
committerPierre Ossman <ossman@cendio.se>
Mon, 23 Dec 2019 14:42:02 +0000 (15:42 +0100)
Internet Explorer doesn't have this method. Use the safer indexOf()
instead.

app/ui.js

index 7651d3e56705bf01b27157b1b4db13933460fd43..347a2af838f0115269c112cb3a42486effe88ecb 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
@@ -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;