mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
Update logic for multi-select
This commit is contained in:
+11
-10
@@ -82,21 +82,22 @@ iD.modes.Select = function(context, selection, initial) {
|
||||
inspector
|
||||
.on('changeTags', changeTags)
|
||||
.on('close', function() { context.enter(iD.modes.Browse(context)); });
|
||||
}
|
||||
|
||||
context.history().on('change.select', function() {
|
||||
context.history().on('change.select', function() {
|
||||
context.surface().call(radialMenu.close);
|
||||
|
||||
if (_.any(selection, function (id) { return !context.entity(id); })) {
|
||||
// Exit mode if selected entity gets undone
|
||||
var oldEntity = entity,
|
||||
newEntity = context.entity(selection[0]);
|
||||
context.enter(iD.modes.Browse(context));
|
||||
|
||||
if (!newEntity) {
|
||||
context.enter(iD.modes.Browse(context));
|
||||
} else if (!_.isEqual(oldEntity.tags, newEntity.tags)) {
|
||||
} else if (entity) {
|
||||
var newEntity = context.entity(selection[0]);
|
||||
if (!_.isEqual(entity.tags, newEntity.tags)) {
|
||||
inspector.tags(newEntity.tags);
|
||||
}
|
||||
|
||||
context.surface().call(radialMenu.close);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
context.map().on('move.select', function() {
|
||||
context.surface().call(radialMenu.close);
|
||||
|
||||
Reference in New Issue
Block a user