Added shortcut to select parent way

This commit is contained in:
Minh Nguyễn
2020-12-21 21:59:50 -08:00
parent ea4b30d12b
commit 2fff6aec93
3 changed files with 15 additions and 0 deletions

View File

@@ -2258,6 +2258,7 @@ en:
next: "Jump to next node"
first: "Jump to first node"
last: "Jump to last node"
parent: "Select parent way"
change_parent: "Switch parent way"
editing:
title: "Editing"

View File

@@ -158,6 +158,10 @@
"shortcuts": ["}", "⇟"],
"text": "shortcuts.browsing.vertex_selected.last"
},
{
"shortcuts": [">"],
"text": "shortcuts.browsing.vertex_selected.parent"
},
{
"shortcuts": ["\\", "shortcuts.key.pause"],
"text": "shortcuts.browsing.vertex_selected.change_parent"

View File

@@ -245,6 +245,7 @@ export function modeSelect(context, selectedIDs) {
.on(utilKeybinding.minusKeys.map((key) => uiCmd('⇧' + key)), scaleSelection(1/1.05))
.on(utilKeybinding.minusKeys.map((key) => uiCmd('⇧⌥' + key)), scaleSelection(1/Math.pow(1.05, 5)))
.on(['\\', 'pause'], nextParent)
.on('>', selectParent)
.on('⎋', esc, true);
d3_select(document)
@@ -561,6 +562,15 @@ export function modeSelect(context, selectedIDs) {
.classed('related', true);
}
}
function selectParent(d3_event) {
d3_event.preventDefault();
if (_relatedParent) {
context.enter(
modeSelect(context, [_relatedParent])
);
}
}
};