From 47d44b49f1ec6b44dd310ecb75190295710d3b5d Mon Sep 17 00:00:00 2001 From: Neroth Date: Tue, 23 Jul 2013 03:40:22 +0200 Subject: [PATCH] Fix bug --- src/extension.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/extension.js b/src/extension.js index e0cb8bb..de346c8 100644 --- a/src/extension.js +++ b/src/extension.js @@ -82,7 +82,7 @@ const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension settin this.variation("distance_units"); this.variation("pressure_units"); this.variation("cities"); - this.variation("city"); + this.variation("city_name"); this.variation("symbolic_icon"); this.variation("text_in_panel"); this.variation("position_in_panel"); @@ -304,7 +304,7 @@ const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension settin let speedUnitVar = this.variation("speed_units"); let distUnitVar = this.variation("distance_units"); let presUnitVar = this.variation("pressure_units"); - let cityVar = this.variation("city"); + let cityVar = this.variation("city_name"); let textInPanelVar = this.variation("text_in_panel"); let commentInPanelVar = this.variation("comment_in_panel"); let windDirectionVar = this.variation("wind_direction"); @@ -666,7 +666,7 @@ const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension settin } } - if(this.variation("cities") || this.variation("city",true)) + if(this.variation("cities") || this.variation("city_name",true)) { this.rebuildLocationSelectorItem(); this.status("Location selector rebuilded"); } @@ -1140,7 +1140,7 @@ const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension settin || this.variation("comment_in_panel",true) || this.variation("wind_direction",true)) this.refresh(); - if((typeof this.location != "undefined" && !this.location.equal(this.city)) || !this.info) + if(this.variation("city_name", true)) { this.status("Location has changed"); this.restart(); this.status("Location changed to "+this.location.get_city_name()); return 0; @@ -1314,6 +1314,14 @@ const WEATHER_DEBUG_EXTENSION = 'debug-extension'; // Weather extension settin return 0; }, + get city_name() + { + if(typeof this.city == "undefined") + return ""; + else + return this.city.get_city_name(); + }, + get symbolic_icon() { if(!this.settings)