weathersettings cleanup

This commit is contained in:
Gerome Matilla 2020-06-13 18:32:41 +08:00
parent 3974ec6da9
commit 6151380ab1

View File

@ -57,8 +57,8 @@ class WeatherSettings {
// Reset textboxes // Reset textboxes
_deleteWeatherSettingsValue = () => { _deleteWeatherSettingsValue = () => {
this._apiKeySet.value = ''; this._apiKeySet.value = null;
this._cityIDSet.value = ''; this._cityIDSet.value = null;
this._weatherSelectUnits.value = 'metric'; this._weatherSelectUnits.value = 'metric';
this._weatherSelectLocator.value = 'city'; this._weatherSelectLocator.value = 'city';
} }
@ -238,9 +238,12 @@ class WeatherSettings {
this._deleteWeatherSettingsValue(); this._deleteWeatherSettingsValue();
this._updateWeatherSettingsPlaceholder(); this._updateWeatherSettingsPlaceholder();
// Show city id textbox // Show/hide city id textbox based on the default mode
this._weatherSettingsCityIDGroup.classList.remove('hideWeatherSettings'); if (this._locatorMode === 'geolocation') {
this._weatherSettingsCityIDGroup.classList.add('hideWeatherSettings');
} else if (this._locatorMode === 'city') {
this._weatherSettingsCityIDGroup.classList.remove('hideWeatherSettings');
}
alert('Credentials deleted!'); alert('Credentials deleted!');
} }