Merge branch 'master' of github.com:systemed/iD

This commit is contained in:
Tom MacWright
2013-01-25 18:49:01 -05:00
3 changed files with 9 additions and 11 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ iD.Connection = function() {
}
}
for (i in entities) {
for (i in g.entities) {
if (entities[i].type === 'node') {
g.transient(entities[i], 'poi', d3.functor(false));
}
+5 -9
View File
@@ -2,12 +2,12 @@ iD.Graph = function(entities, mutable) {
if (!(this instanceof iD.Graph)) return new iD.Graph(entities, mutable);
if (_.isArray(entities)) {
this.entities = Object.create(this.original);
this.entities = {};
for (var i = 0; i < entities.length; i++) {
this.entities[entities[i].id] = entities[i];
}
} else {
this.entities = _.extend(Object.create(this.original), entities);
this.entities = entities || {};
}
this.transients = {};
@@ -21,9 +21,6 @@ iD.Graph = function(entities, mutable) {
};
iD.Graph.prototype = {
original: {},
entity: function(id) {
return this.entities[id];
},
@@ -101,10 +98,9 @@ iD.Graph.prototype = {
},
merge: function(graph) {
for (var i in graph.entities) {
this.original[i] = graph.entities[i];
}
return this;
return this.update(function () {
_.defaults(this.entities, graph.entities);
});
},
replace: function(entity) {
+3 -1
View File
@@ -30,7 +30,9 @@ iD.History = function() {
},
merge: function (graph) {
stack[0].graph.merge(graph);
for (var i = 0; i < stack.length; i++) {
stack[i].graph = stack[i].graph.merge(graph);
}
},
perform: function () {