From c7b55d2e38c4a6f0825ca4c17b9f961e6b0e2ce0 Mon Sep 17 00:00:00 2001 From: Gerome Matilla Date: Fri, 12 Jun 2020 14:44:48 +0800 Subject: [PATCH] fix ugly weather settings naming --- index.html | 10 +++++----- js/weather-settings.js | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index db7a3a7..e0146fa 100644 --- a/index.html +++ b/index.html @@ -92,18 +92,18 @@
- +
- - + +
- - + +
diff --git a/js/weather-settings.js b/js/weather-settings.js index e39e8d3..c05d445 100644 --- a/js/weather-settings.js +++ b/js/weather-settings.js @@ -8,8 +8,8 @@ class WeatherSettings { this._cityID = ''; this._units = ''; - this._apiBox = document.querySelector('#apiBox'); - this._cityBox = document.querySelector('#cityBox'); + this._apiKeySet = document.querySelector('#apiKeySet'); + this._cityIDSet = document.querySelector('#cityIDSet'); this._weatherSelectUnits = document.querySelector('#weatherSelectUnits'); @@ -38,15 +38,15 @@ class WeatherSettings { // Reset textboxes _deleteWeatherSettingsValue = () => { - this._apiBox.value = ''; - this._cityBox.value = ''; + this._apiKeySet.value = ''; + this._cityIDSet.value = ''; this._weatherSelectUnits.value = 'metric'; } // Update textbox placeholders _updateWeatherSettingsPlaceholder = () => { - this._apiBox.placeholder = this._appID; - this._cityBox.placeholder = this._cityID; + this._apiKeySet.placeholder = this._appID; + this._cityIDSet.placeholder = this._cityID; this._weatherSelectUnits.value = this._units; } @@ -77,8 +77,8 @@ class WeatherSettings { _weatherApplyOnClickEvent = e => { this._applyWeatherSettings( - this._apiBox.value || this._apiBox.placeholder, - this._cityBox.value || this._cityBox.placeholder, + this._apiKeySet.value || this._apiKeySet.placeholder, + this._cityIDSet.value || this._cityIDSet.placeholder, this._weatherSelectUnits.options[this._weatherSelectUnits.selectedIndex].value ); this._updateWeatherSettings();