mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Select standalone points after dragging them (close #5747)
This commit is contained in:
@@ -362,6 +362,8 @@ export function modeDragNode(context) {
|
||||
function end(entity) {
|
||||
if (_isCancelled) return;
|
||||
|
||||
var wasPoint = entity.geometry(context.graph()) === 'point';
|
||||
|
||||
var d = datum();
|
||||
var nope = (d && d.properties && d.properties.nope) || context.surface().classed('nope');
|
||||
var target = d && d.properties && d.properties.entity; // entity to snap to
|
||||
@@ -400,14 +402,19 @@ export function modeDragNode(context) {
|
||||
);
|
||||
}
|
||||
|
||||
var reselection = _restoreSelectedIDs.filter(function(id) {
|
||||
return context.graph().hasEntity(id);
|
||||
});
|
||||
if (wasPoint) {
|
||||
context.enter(modeSelect(context, [entity.id]));
|
||||
|
||||
if (reselection.length) {
|
||||
context.enter(modeSelect(context, reselection));
|
||||
} else {
|
||||
context.enter(modeBrowse(context));
|
||||
var reselection = _restoreSelectedIDs.filter(function(id) {
|
||||
return context.graph().hasEntity(id);
|
||||
});
|
||||
|
||||
if (reselection.length) {
|
||||
context.enter(modeSelect(context, reselection));
|
||||
} else {
|
||||
context.enter(modeBrowse(context));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user