From 701d4121ed2e15474f52caecd483f1d76e206db3 Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Wed, 30 Mar 2016 10:57:30 -0400 Subject: [PATCH] Fix SSID selection box when aplist only has one entry. --- app/modules/enduser_setup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/modules/enduser_setup.c b/app/modules/enduser_setup.c index 5869765a..d6e44632 100644 --- a/app/modules/enduser_setup.c +++ b/app/modules/enduser_setup.c @@ -209,15 +209,16 @@ static const char http_header_500[] = "HTTP/1.1 500 Internal Error\r\n\r\n"; fetch('/aplist','GET', new_ap_list_repeat); } + function set_ssid_field() { + var sel = document.getElementById("aplist"); + document.getElementById("wifi_ssid").value = sel.value; + } window.onload = function() { refresh_status(); refresh_ap_list(); - document.getElementById("aplist").onchange = function() { - var sel = document.getElementById("aplist"); - document.getElementById("wifi_ssid").value = sel.value; - } + document.getElementById("aplist").onclick = set_ssid_field; document.getElementById("credentialsForm").addEventListener("submit", function(){ fetch('/status','GET', new_status); }); @@ -227,7 +228,7 @@ static const char http_header_500[] = "HTTP/1.1 500 Internal Error\r\n\r\n"; #endif static const char http_html_backup[] = -"WiFi Login

WiFi Login

Connect gadget to your WiFi network

Status: Updating...

"; +"WiFi Login

WiFi Login

Connect gadget to your WiFi network

Status: Updating...

"; typedef struct scan_listener