Skip to content

Commit

Permalink
minor tweaks to search parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
triceam committed Oct 9, 2012
1 parent 1b934b2 commit 62e2476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
7 changes: 3 additions & 4 deletions client/www/app/model/SearchManager.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@

window.SearchManager = {

//apiUrl:"http://localhost:3000/api?",
apiUrl:"http://walkable.aws.af.cm/restaurants-api?",

apiUrl:"http://localhost:3000/restaurants-api?",

search:function (searchString, successCallback, errorCallback) {
var searchURL = this.apiUrl + "q=" + encodeURIComponent(searchString) + "&ll=" + window.GeoWatcher.position.latitude + "," + window.GeoWatcher.position.longitude + "&d=" + new Date().getTime();

$.ajax({
timeout:10000,
timeout:20000,
url:searchURL,
success:function(result){
if ( successCallback ) {
Expand Down
12 changes: 1 addition & 11 deletions client/www/app/views/SearchView.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ window.SearchView = Backbone.View.extend({

try {
var jsonResult = JSON.parse(result);

var self = this;

//cleanup once removed from view
setTimeout(function(){
self.$el.empty();
}, 550 );

var view = new SearchResultsView({ model:jsonResult, searchString:this.searchString });
window.viewNavigator.replaceView( view );
}
Expand All @@ -62,14 +54,12 @@ window.SearchView = Backbone.View.extend({

searchError: function(error) {
// console.log(error);

var self = this;

//wait for transition to finish, then cleanup once removed from view
setTimeout(function(){
self.$el.empty();

var view = new SearchResultsView({ model:{points:[], polygons:[]}, searchString:this.searchString });
var view = new SearchResultsView({ model:{points:[], polygons:[]}, searchString:self.searchString });
window.viewNavigator.replaceView( view );
}, 550 );
}
Expand Down

0 comments on commit 62e2476

Please sign in to comment.