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 class="mdl-select">
<select id="selectHost">
<option value="">No history available</option>
</select>
</div>
<div class="button-holder">

View File

@ -151,6 +151,7 @@ function hostChosen() {
hosts.push(target);
saveHosts();
$('#GFEHostIPField').val(''); // eat the contents of the textbox
$('#GFEHostIPField').parent().removeClass('is-dirty');
}
showApps();
});
@ -405,9 +406,6 @@ function onWindowLoad(){
// load previously connected hosts
chrome.storage.sync.get('hosts', function(previousValue) {
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.
var opt = document.createElement('option');
opt.appendChild(document.createTextNode(hosts[i]));