mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
selectChild as standalone.
Keyboard shortcuts new section - way selected Moved 'help' section to left in keyboard section
This commit is contained in:
@@ -2300,8 +2300,10 @@ en:
|
||||
first: "Jump to first node"
|
||||
last: "Jump to last node"
|
||||
parent: "Select parent way"
|
||||
child: "Select child node"
|
||||
change_parent: "Switch parent way"
|
||||
way_selected:
|
||||
title: "With way selected"
|
||||
child: "Select child node"
|
||||
editing:
|
||||
title: "Editing"
|
||||
drawing:
|
||||
|
||||
@@ -85,11 +85,7 @@
|
||||
{
|
||||
"shortcuts": ["map_data.highlight_edits.key"],
|
||||
"text": "shortcuts.browsing.display_options.highlight_edits"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"rows": [
|
||||
},
|
||||
{
|
||||
"section": "help",
|
||||
"text": "shortcuts.browsing.help.title"
|
||||
@@ -101,7 +97,11 @@
|
||||
{
|
||||
"shortcuts": ["shortcuts.toggle.key", "?"],
|
||||
"text": "shortcuts.browsing.help.keyboard"
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"rows": [
|
||||
{
|
||||
"section": "selecting",
|
||||
"text": "shortcuts.browsing.selecting.title"
|
||||
@@ -163,14 +163,18 @@
|
||||
"shortcuts": ["↑"],
|
||||
"text": "shortcuts.browsing.vertex_selected.parent"
|
||||
},
|
||||
{
|
||||
"modifiers": ["⌘"],
|
||||
"shortcuts": ["↓"],
|
||||
"text": "shortcuts.browsing.vertex_selected.child"
|
||||
},
|
||||
{
|
||||
"shortcuts": ["\\", "shortcuts.key.pause"],
|
||||
"text": "shortcuts.browsing.vertex_selected.change_parent"
|
||||
},
|
||||
{
|
||||
"section": "way_selected",
|
||||
"text": "shortcuts.browsing.way_selected.title"
|
||||
},
|
||||
{
|
||||
"modifiers": ["⌘"],
|
||||
"shortcuts": ["↓"],
|
||||
"text": "shortcuts.browsing.way_selected.child"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
2
dist/locales/en.min.json
vendored
2
dist/locales/en.min.json
vendored
File diff suppressed because one or more lines are too long
@@ -113,6 +113,31 @@ export function modeSelect(context, selectedIDs) {
|
||||
return parents;
|
||||
}
|
||||
|
||||
// find the child nodes for selected ways
|
||||
function childNodeIdsOfSelection(onlyCommon) {
|
||||
var graph = context.graph();
|
||||
var childs = [];
|
||||
|
||||
for (var i = 0; i < selectedIDs.length; i++) {
|
||||
var entity = context.hasEntity(selectedIDs[i]);
|
||||
|
||||
if (!entity || !['area', 'line'].includes(entity.geometry(graph))){
|
||||
return []; // selection includes non-area/non-line
|
||||
}
|
||||
var currChilds = graph.childNodes(entity).map(function(node) { return node.id; });
|
||||
if (!childs.length) {
|
||||
childs = currChilds;
|
||||
continue;
|
||||
}
|
||||
|
||||
childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds);
|
||||
if (!childs.length) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
return childs;
|
||||
}
|
||||
|
||||
function checkFocusedParent() {
|
||||
if (_focusedParentWayId) {
|
||||
@@ -590,16 +615,14 @@ export function modeSelect(context, selectedIDs) {
|
||||
d3_event.preventDefault();
|
||||
|
||||
var currentSelectedIds = mode.selectedIDs();
|
||||
var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false);
|
||||
if (parentIds.length) return;
|
||||
|
||||
var reselectIds = _focusedVertexIds && _focusedVertexIds.filter(id => context.hasEntity(id));
|
||||
if (!reselectIds || !reselectIds.length) return;
|
||||
var childIds = _focusedVertexIds ? _focusedVertexIds.filter(id => context.hasEntity(id)) : childNodeIdsOfSelection(true);
|
||||
if (!childIds || !childIds.length) return;
|
||||
|
||||
if (currentSelectedIds.length === 1) _focusedParentWayId = currentSelectedIds[0];
|
||||
|
||||
context.enter(
|
||||
mode.selectedIDs(_focusedVertexIds)
|
||||
mode.selectedIDs(childIds)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user