[gnome-maps/wip/templates] Sidebar: Fix another templates bug
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/templates] Sidebar: Fix another templates bug
- Date: Thu, 20 Nov 2014 20:41:34 +0000 (UTC)
commit 0391f39091e54073ff6ddf1535ed5853395cc676
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date: Thu Nov 20 21:41:02 2014 +0100
Sidebar: Fix another templates bug
src/sidebar.js | 31 ++++++++++++++++---------------
1 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/src/sidebar.js b/src/sidebar.js
index 5db8e07..4c12711 100644
--- a/src/sidebar.js
+++ b/src/sidebar.js
@@ -113,22 +113,23 @@ const Sidebar = new Lang.Class({
this._modeBikeToggle.connect('toggled',
onToggle.bind(this, transport.BIKE));
- let setToggles = function() {
- switch(query.transportation) {
- case transport.PEDESTRIAN:
- this._modePedestrianToggle.active = true;
- break;
- case transport.CAR:
- this._modeCarToggle.active = true;
- break;
- case transport.BIKE:
- this._modeBikeToggle.active = true;
- break;
- }
- };
+ this._syncTransportationToggles();
+ query.connect('notify::transportation',
+ this._syncTransportationToggles.bind(this));
+ },
- setToggles();
- query.connect('notify::transportation', setToggles);
+ _syncTransportationToggles: function() {
+ switch(Application.routeService.query.transportation) {
+ case RouteQuery.Transportation.PEDESTRIAN:
+ this._modePedestrianToggle.active = true;
+ break;
+ case RouteQuery.Transportation.CAR:
+ this._modeCarToggle.active = true;
+ break;
+ case RouteQuery.Transportation.BIKE:
+ this._modeBikeToggle.active = true;
+ break;
+ }
},
_initQuerySignals: function(listbox) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]