Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
If you select an address from the dropbox, it will replace the curren…
Browse files Browse the repository at this point in the history
…t value in the input field. Fixes #21.
  • Loading branch information
palewire committed Aug 5, 2011
1 parent 08f2c18 commit ee430de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jquery.geocodify.js
Expand Up @@ -231,6 +231,8 @@
} else if (count === 1 && force) {
settings.onSelect(results[0]);
$this.reset();
$this.previousSearch = results[0].formatted_address;
input.val(results[0].formatted_address);
} else {
var ul = $("<ul>").css({'margin': 0, 'padding': 0, 'background-color': 'white'});
$.each(keep, function(i, val) {
Expand All @@ -244,7 +246,12 @@
'font-size': settings.fontSize,
'text-align': 'left'
})
.click(function(){settings.onSelect(val); $this.reset();})
.click(function(){
settings.onSelect(val);
$this.reset();
$this.previousSearch = val.formatted_address;
input.val(val.formatted_address);
})
.hover(
function() {
$(this).css({'background-color': '#EEE', 'cursor': 'pointer'});
Expand Down

0 comments on commit ee430de

Please sign in to comment.