Skip to content

Commit

Permalink
Use the tilde key (`) for opening the Add Feature preset browser inst…
Browse files Browse the repository at this point in the history
…ead of Tab (close #6560)

Use the apostrophe key (') for toggling the sidebar
  • Loading branch information
quincylvania committed Jun 24, 2019
1 parent 59b51f3 commit 61407a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ en:
add_feature:
search_placeholder: Search feature types
description: "Browse features to add to the map."
key: Tab
# The hotkey to open the Add Feature preset browser. Expect the key adjacent to the number row.
key: "`"
result: "{count} result"
results: "{count} results"
add_area:
Expand Down Expand Up @@ -477,7 +478,7 @@ en:
report_a_bug: Report a bug
help_translate: Help translate
sidebar:
key: '`'
key: "'"
tooltip: Toggle the sidebar.
feature_info:
hidden_warning: "{count} hidden features"
Expand Down
4 changes: 2 additions & 2 deletions dist/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"add_feature": {
"search_placeholder": "Search feature types",
"description": "Browse features to add to the map.",
"key": "Tab",
"key": "`",
"result": "{count} result",
"results": "{count} results"
},
Expand Down Expand Up @@ -620,7 +620,7 @@
"report_a_bug": "Report a bug",
"help_translate": "Help translate",
"sidebar": {
"key": "`",
"key": "'",
"tooltip": "Toggle the sidebar."
},
"feature_info": {
Expand Down
2 changes: 1 addition & 1 deletion modules/ui/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export function uiInit(context) {
var panPixels = 80;
context.keybinding()
.on('⌫', function() { d3_event.preventDefault(); })
.on([t('sidebar.key'), '`', '²'], ui.sidebar.toggle) // #5663 - common QWERTY, AZERTY
.on(t('sidebar.key'), ui.sidebar.toggle)
.on('←', pan([panPixels, 0]))
.on('↑', pan([0, panPixels]))
.on('→', pan([-panPixels, 0]))
Expand Down
5 changes: 3 additions & 2 deletions modules/ui/tools/add_feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function uiToolAddFeature(context) {
var button = d3_select(null);

var key = t('modes.add_feature.key');
var keys = [key, '`', '²']; // #5663 - common QWERTY, AZERTY

tool.render = function(selection) {

Expand Down Expand Up @@ -69,7 +70,7 @@ export function uiToolAddFeature(context) {

tool.install = function() {

context.keybinding().on(key, function() {
context.keybinding().on(keys, function() {
button.classed('active', true);

presetBrowser.show();
Expand All @@ -87,7 +88,7 @@ export function uiToolAddFeature(context) {
tool.uninstall = function() {
presetBrowser.hide();

context.keybinding().off(key);
context.keybinding().off(keys);

context.features()
.on('change.add-feature-tool', null);
Expand Down

0 comments on commit 61407a5

Please sign in to comment.