Hook up connection and history in context

This commit is contained in:
John Firebaugh
2013-02-02 19:46:59 -05:00
parent fc00f154a9
commit ec602a7db7
2 changed files with 4 additions and 7 deletions

View File

@@ -16,6 +16,10 @@ window.iD = function () {
// the connection requires .storage() to be available on calling.
var connection = iD.Connection(context);
connection.on('load.context', function (err, result) {
history.merge(result);
});
/* Straight accessors. Avoid using these if you can. */
context.ui = function() { return ui; };
context.connection = function() { return connection; };

View File

@@ -26,9 +26,6 @@ iD.Map = function(context) {
surface, tilegroup;
function map(selection) {
context.connection()
.on('load.tile', connectionLoad);
context.history()
.on('change.map', redraw);
@@ -100,10 +97,6 @@ iD.Map = function(context) {
surface.selectAll('.layer *').remove();
}
function connectionLoad(err, result) {
context.history().merge(result);
}
function zoomPan() {
if (d3.event && d3.event.sourceEvent.type === 'dblclick') {
if (!dblclickEnabled) {