Keybind all of _uniq([t(sidebar.key), '`', '²']) to toggle sidebar

(closes #5663)
This commit is contained in:
Bryan Housel
2019-01-06 00:33:35 -05:00
parent 5567b2b077
commit 55d2dddb70
2 changed files with 8 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
import _uniq from 'lodash-es/uniq';
import {
event as d3_event,
select as d3_select
@@ -298,9 +300,10 @@ export function uiInit(context) {
var panPixels = 80;
var sidebarKeys = _uniq([t('sidebar.key'), '`', '²']); // #5663
context.keybinding()
.on('⌫', function() { d3_event.preventDefault(); })
.on(t('sidebar.key'), ui.sidebar.toggle)
.on(sidebarKeys, ui.sidebar.toggle)
.on('←', pan([panPixels, 0]))
.on('↑', pan([0, panPixels]))
.on('→', pan([-panPixels, 0]))

View File

@@ -1,3 +1,5 @@
import _uniq from 'lodash-es/uniq';
import {
select as d3_select,
selectAll as d3_selectAll
@@ -177,6 +179,8 @@ export function uiShortcuts(context) {
arr = ['Y'];
} else if (detected.os !== 'mac' && d.text === 'shortcuts.browsing.display_options.fullscreen') {
arr = ['F11'];
} else if (d.text === 'shortcuts.browsing.display_options.sidebar') {
arr = _uniq([t('sidebar.key'), '`', '²']); // #5663
}
return arr.map(function(s) {