Skip to content

Commit

Permalink
Location distance slider now updates the distances in the location re…
Browse files Browse the repository at this point in the history
…sult links
  • Loading branch information
galen committed May 24, 2012
1 parent 8233b1b commit a5dfd05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ switch( $("body").attr( "id" ) ) {
max: location_search_distance_max,
slide: function( event, ui ) {
$("#distance_value").html( ui.value );
},
stop: function( event, ui ){
$("#location_chooser li a").each(function(){
$(this).attr('href', $(this).data('tpl').replace('##distance##', ui.value ) );
});
}
});

Expand All @@ -27,7 +32,7 @@ switch( $("body").attr( "id" ) ) {
search_options['tag'].template = "<li><a href=\"/tag/${tag}/\">${tag}</a></li>";
search_options['location'].api_url = '/api/?method=geocode&location=';
search_options['location'].error = 'Please enter a location';
search_options['location'].template = "<li><a href=\"/location/${lat},${lng}/${distance}/${location_encoded}/\">${location}</a></li>";
search_options['location'].template = "<li><a data-tpl=\"/location/${lat},${lng}/##distance##/${location_encoded}/\" href=\"/location/${lat},${lng}/${distance}/${location_encoded}/\">${location}</a></li>";
$("#search_options form").submit(function(){
var search_type = $(this).data("search-type");
if ( $("#search_" + search_type +"_text").val().trim() === '' ) {
Expand Down

0 comments on commit a5dfd05

Please sign in to comment.