Search progress indicator

Source: https://gist.github.com/tmcw/5153896
This commit is contained in:
Tom MacWright
2013-03-13 12:39:08 -04:00
parent e295e70db7
commit 327e8f90db
3 changed files with 7 additions and 0 deletions
+5
View File
@@ -298,6 +298,11 @@ form.hide {
.margin1 {margin: 10px;}
.margin2 {margin: 20px;}
.loading {
background: url(../img/loader_bg.gif);
background-size:5px 5px;
}
/* Buttons */
button {
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

+2
View File
@@ -16,8 +16,10 @@ iD.ui.Geocoder = function(context) {
if (d3.event.keyCode !== 13) return;
d3.event.preventDefault();
var searchVal = this.value;
inputNode.classed('loading', true);
d3.json('http://nominatim.openstreetmap.org/search/' +
encodeURIComponent(searchVal) + '?limit=10&format=json', function(err, resp) {
inputNode.classed('loading', false);
if (err) return hide();
if (!resp.length) {
return iD.ui.flash(context.container())