Remove jQuery dependency more

This commit is contained in:
Tom MacWright
2012-10-26 16:47:46 -04:00
parent 69940890fc
commit 34b64267b5
2 changed files with 10 additions and 13 deletions
+9 -12
View File
@@ -90,21 +90,18 @@
map.controller.setState(new iD.controller.shape.NoSelection());
});
function grid(resp) {
map.setCentre({
lon: resp.results[0][0].lon,
lat: resp.results[0][0].lat
});
}
d3.select('#geocode-form').on('submit', function() {
d3.event.preventDefault();
var val = d3.select('#geocode-location').node().value;
$.ajax({
url: 'http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
encodeURIComponent(val) + '.jsonp',
dataType: 'jsonp',
jsonpCallback: 'grid',
success: function(resp) {
map.setCentre({
lon: resp.results[0][0].lon,
lat: resp.results[0][0].lat
});
}
});
var scr = document.body.appendChild(document.createElement('script'));
scr.src = 'http://api.tiles.mapbox.com/v3/mapbox/geocode/' +
encodeURIComponent(val) + '.jsonp?callback=grid';
});
/*
+1 -1
View File
@@ -28,7 +28,7 @@ define(['dojo/_base/declare', 'iD/actions/UndoableAction'],
if (this.newNode === null) {
this.newNode = this.connection.doCreateNode(this.tags,
this.lat, this.lon,
_.bind(this.push, this));
this.push.bind(this));
}
this.connection.registerPOI(this.newNode);
return true;