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

Conflicts:
	js/id/actions/modes.js
This commit is contained in:
Tom MacWright
2012-12-03 16:25:39 -05:00
2 changed files with 11 additions and 6 deletions

View File

@@ -48,6 +48,7 @@ iD.modes.AddPlace = {
n._poi = true;
this.map.perform(iD.actions.addNode(n));
this.map.selectEntity(n);
this.controller.exit();
this.exit();
}
@@ -55,7 +56,7 @@ iD.modes.AddPlace = {
.on('click.addplace', click.bind(this));
d3.select(document).on('keydown.addplace', function() {
if (d3.event.keyCode === 27) this.exit();
if (d3.event.keyCode === 27) this.controller.exit();
}.bind(this));
},
exit: function() {
@@ -139,7 +140,7 @@ iD.modes.AddRoad = {
.on('mousemove.addroad', mousemove);
d3.select(document).on('keydown.addroad', function() {
if (d3.event.keyCode === 27) this.exit();
if (d3.event.keyCode === 27) this.controller.exit();
}.bind(this));
},
exit: function() {
@@ -203,7 +204,7 @@ iD.modes.DrawRoad = function(way_id, direction) {
this.map.perform(iD.actions.changeTags(way, way.tags));
this.map.selectEntity(way);
// End by clicking on own tail
return this.exit();
return this.controller.exit();
} else {
// connect a way to an existing way
node = t.data()[0];
@@ -289,7 +290,7 @@ iD.modes.AddArea = {
surface.on('click.addarea', click.bind(this));
d3.select(document).on('keydown.addarea', function() {
if (d3.event.keyCode === 27) this.exit();
if (d3.event.keyCode === 27) this.controller.exit();
}.bind(this));
},
exit: function() {
@@ -342,7 +343,7 @@ iD.modes.DrawArea = function(way_id) {
delete way.tags.elastic;
this.map.perform(iD.actions.changeTags(way, way.tags));
// End by clicking on own tail
return this.exit();
return this.controller.exit();
} else {
// connect a way to an existing way
node = t.data()[0];

View File

@@ -16,7 +16,11 @@ iD.Controller = function(map) {
event.enter(mode);
};
controller.enter(iD.modes.Move);
controller.exit = function() {
controller.enter(iD.modes.Move);
};
controller.exit();
return d3.rebind(controller, event, 'on');
};