From d3e78083e89e0b8d882ea0da79cb5997f6097210 Mon Sep 17 00:00:00 2001 From: frankiefu Date: Wed, 8 Jan 2014 12:20:31 -0800 Subject: [PATCH] fix so update() will show all the stops --- shuttle-stop-picker.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shuttle-stop-picker.html b/shuttle-stop-picker.html index dea7e57..8807d07 100644 --- a/shuttle-stop-picker.html +++ b/shuttle-stop-picker.html @@ -198,20 +198,19 @@ }, queryChanged: function() { this.showAll = false; - this.mode = this.query ? 1 : 0; this.asyncSearch(); }, asyncSearch: function() { this.searchJob = this.job(this.searchJob, this.search, 300); }, search: function() { - var q = this.query && this.query.toLowerCase(); + var q = this.showAll ? '' : (this.query && this.query.toLowerCase()); + this.mode = q ? 1 : 0; this.groups.forEach(function(g) { var t = g.stops.length; var gh = g.name.toLowerCase().indexOf(q) < 0; g.stops.forEach(function(s) { - s.hidden = !this.showAll && - s.name.toLowerCase().indexOf(q) < 0 && gh; + s.hidden = s.name.toLowerCase().indexOf(q) < 0 && gh; }.bind(this)); }.bind(this)); this.fire('shuttle-stops-search');