fixed minor issue with eating hostname field and textbox updates

This commit is contained in:
R. Aidan Campbell 2016-04-16 13:27:46 -04:00
parent dda060acb9
commit ff753adcfe
2 changed files with 1 additions and 4 deletions

View File

@ -49,7 +49,6 @@
</div> </div>
<div class="mdl-select"> <div class="mdl-select">
<select id="selectHost"> <select id="selectHost">
<option value="">No history available</option>
</select> </select>
</div> </div>
<div class="button-holder"> <div class="button-holder">

View File

@ -151,6 +151,7 @@ function hostChosen() {
hosts.push(target); hosts.push(target);
saveHosts(); saveHosts();
$('#GFEHostIPField').val(''); // eat the contents of the textbox $('#GFEHostIPField').val(''); // eat the contents of the textbox
$('#GFEHostIPField').parent().removeClass('is-dirty');
} }
showApps(); showApps();
}); });
@ -405,9 +406,6 @@ function onWindowLoad(){
// load previously connected hosts // load previously connected hosts
chrome.storage.sync.get('hosts', function(previousValue) { chrome.storage.sync.get('hosts', function(previousValue) {
hosts = previousValue.hosts != null ? previousValue.hosts : []; hosts = previousValue.hosts != null ? previousValue.hosts : [];
if ($('#selectHost')[0].length > 0) {
$('#selectHost')[0].remove($('#selectHost')[0].selectedIndex);
}
for(var i = 0; i < hosts.length; i++) { // programmatically add each new host. for(var i = 0; i < hosts.length; i++) { // programmatically add each new host.
var opt = document.createElement('option'); var opt = document.createElement('option');
opt.appendChild(document.createTextNode(hosts[i])); opt.appendChild(document.createTextNode(hosts[i]));