From c9df5ef9f9d50f59b07eca3f96066a747e392c2a Mon Sep 17 00:00:00 2001 From: Gerome Matilla Date: Sat, 13 Jun 2020 18:38:06 +0800 Subject: [PATCH] weathersettings add default locator variable --- js/weather-settings.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/weather-settings.js b/js/weather-settings.js index 7e046b5..6ba503e 100644 --- a/js/weather-settings.js +++ b/js/weather-settings.js @@ -7,6 +7,9 @@ class WeatherSettings { this._appID = ''; this._cityID = ''; this._units = ''; + + this._defaultLocator = 'city'; + this._locatorMode = ''; // Geolocation data @@ -60,7 +63,7 @@ class WeatherSettings { this._apiKeySet.value = null; this._cityIDSet.value = null; this._weatherSelectUnits.value = 'metric'; - this._weatherSelectLocator.value = 'city'; + this._weatherSelectLocator.value = this._defaultLocator; } // Apply credentials @@ -76,7 +79,7 @@ class WeatherSettings { this._appID = this._localStorage.getItem('apiKey') || 'API Key'; this._cityID = this._localStorage.getItem('cityID') || 'City ID'; this._units = this._localStorage.getItem('units') || 'metric'; - this._locatorMode = this._localStorage.getItem('locatorMode') || 'city'; + this._locatorMode = this._localStorage.getItem('locatorMode') || this._defaultLocator; } // Update textbox placeholders