From d09478c3db288aa7817e6a899251768c7f37906d Mon Sep 17 00:00:00 2001 From: frankiefu Date: Wed, 18 Dec 2013 15:48:22 -0800 Subject: [PATCH] make showAll stops working --- shuttle-stop-picker.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/shuttle-stop-picker.html b/shuttle-stop-picker.html index 0e6819f..dea7e57 100644 --- a/shuttle-stop-picker.html +++ b/shuttle-stop-picker.html @@ -150,7 +150,7 @@ query: '', mode: 0, update: function() { - this.query = ''; + this.showAll = true; this.search(); if (this.selectedItem) { this.scrollToStop(this.selectedItem); @@ -197,6 +197,7 @@ } }, queryChanged: function() { + this.showAll = false; this.mode = this.query ? 1 : 0; this.asyncSearch(); }, @@ -209,9 +210,10 @@ var t = g.stops.length; var gh = g.name.toLowerCase().indexOf(q) < 0; g.stops.forEach(function(s) { - s.hidden = s.name.toLowerCase().indexOf(q) < 0 && gh; - }); - }); + s.hidden = !this.showAll && + s.name.toLowerCase().indexOf(q) < 0 && gh; + }.bind(this)); + }.bind(this)); this.fire('shuttle-stops-search'); }, hideKeyboard: function() {