Hide menu on history changes

This commit is contained in:
John Firebaugh
2013-01-24 18:45:06 -05:00
parent 66a0d0bdbd
commit 3f7b7c6a5a
+5 -3
View File
@@ -79,8 +79,8 @@ iD.modes.Select = function(entity, initial) {
.on('changeTags', changeTags)
.on('close', function() { mode.controller.exit(); });
// Exit mode if selected entity gets undone
history.on('change.entity-undone', function() {
history.on('change.select', function() {
// Exit mode if selected entity gets undone
var old = entity;
entity = history.graph().entity(entity.id);
if (!entity) {
@@ -88,6 +88,8 @@ iD.modes.Select = function(entity, initial) {
} else if(!_.isEqual(entity.tags, old.tags)) {
inspector.tags(entity.tags);
}
surface.call(radialMenu.close);
});
function click() {
@@ -174,7 +176,7 @@ iD.modes.Select = function(entity, initial) {
surface.on('click.select', null)
.on('dblclick.select', null);
history.on('change.entity-undone', null);
history.on('change.select', null);
surface.selectAll(".selected")
.classed('selected', false);