mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 09:34:04 +02:00
Do is a reserved word, jshint is displeased.
This commit is contained in:
@@ -39,7 +39,7 @@ iD.actions.AddPlace = {
|
||||
surface.on('click.addplace', function() {
|
||||
var ll = this.map.projection.invert(
|
||||
d3.mouse(surface.node()));
|
||||
this.map.do(iD.operations.addNode(iD.actions._node(ll)));
|
||||
this.map.operate(iD.operations.addNode(iD.actions._node(ll)));
|
||||
this.exit();
|
||||
}.bind(this));
|
||||
|
||||
@@ -95,7 +95,7 @@ iD.actions.AddRoad = {
|
||||
var node = iD.actions._node(ll);
|
||||
way.nodes.push(node.id);
|
||||
|
||||
this.map.do(iD.operations.changeWayNodes(way, node));
|
||||
this.map.operate(iD.operations.changeWayNodes(way, node));
|
||||
this.controller.go(iD.actions.DrawRoad(way));
|
||||
}.bind(this));
|
||||
|
||||
@@ -119,7 +119,7 @@ iD.actions.DrawRoad = function(way) {
|
||||
|
||||
this.falsenode = iD.actions._node([0, 0]);
|
||||
|
||||
this.map.do(iD.operations.addTemporary(this.falsenode));
|
||||
this.map.operate(iD.operations.addTemporary(this.falsenode));
|
||||
// way.nodes = way.nodes.slice();
|
||||
way.nodes.push(this.falsenode.id);
|
||||
|
||||
@@ -140,7 +140,7 @@ iD.actions.DrawRoad = function(way) {
|
||||
|
||||
way.nodes.push(node.id);
|
||||
|
||||
this.map.do(iD.operations.changeWayNodes(way, node));
|
||||
this.map.operate(iD.operations.changeWayNodes(way, node));
|
||||
|
||||
way.nodes = way.nodes.slice();
|
||||
way.nodes.push(this.falsenode.id);
|
||||
@@ -152,7 +152,7 @@ iD.actions.DrawRoad = function(way) {
|
||||
}.bind(this));
|
||||
},
|
||||
exit: function() {
|
||||
this.map.do(iD.operations.addTemporary(this.falsenode));
|
||||
this.map.operate(iD.operations.addTemporary(this.falsenode));
|
||||
this.map.surface.on('mousemove.drawroad', null);
|
||||
this.map.surface.on('click.drawroad', null);
|
||||
d3.select(document).on('.drawroad', null);
|
||||
|
||||
@@ -9,7 +9,7 @@ iD.operations.noop = function() {
|
||||
iD.operations.addNode = function(node) {
|
||||
return function(graph) {
|
||||
return graph.replace(node, 'added a place');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
iD.operations.startWay = function(way) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.Graph = function(entities, annotation) {
|
||||
if (!(this instanceof iD.Graph)) return new iD.Graph(entities, annotation)
|
||||
if (!(this instanceof iD.Graph)) return new iD.Graph(entities, annotation);
|
||||
this.entities = entities || {};
|
||||
this.annotation = annotation;
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ iD.History.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
do: function(operation) {
|
||||
operate: function(operation) {
|
||||
this.stack = this.stack.slice(0, this.index + 1);
|
||||
this.stack.push(operation(this.graph()));
|
||||
this.index++;
|
||||
|
||||
@@ -42,7 +42,7 @@ iD.Map = function(elem) {
|
||||
return { x: p[0], y: p[1] };
|
||||
})
|
||||
.on('dragstart', function() {
|
||||
history.do(iD.operations.noop());
|
||||
history.operate(iD.operations.noop());
|
||||
})
|
||||
.on('drag', function(entity) {
|
||||
var to = projection.invert([d3.event.x, d3.event.y]);
|
||||
@@ -222,11 +222,11 @@ iD.Map = function(elem) {
|
||||
}
|
||||
|
||||
inspector.on('change', function(d, tags) {
|
||||
map.do(iD.operations.changeTags(d, tags));
|
||||
map.operate(iD.operations.changeTags(d, tags));
|
||||
});
|
||||
|
||||
inspector.on('remove', function(d) {
|
||||
map.do(iD.operations.remove(d));
|
||||
map.operate(iD.operations.remove(d));
|
||||
});
|
||||
|
||||
var fastTranslate = [0,0];
|
||||
@@ -282,7 +282,7 @@ iD.Map = function(elem) {
|
||||
});
|
||||
|
||||
function _do(operation) {
|
||||
history.do(operation);
|
||||
history.operate(operation);
|
||||
map.update();
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ iD.Map = function(elem) {
|
||||
map.history = history;
|
||||
map.surface = surface;
|
||||
|
||||
map.do = _do;
|
||||
map.operate = _do;
|
||||
map.undo = undo;
|
||||
map.redo = redo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user