mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Keybind all of _uniq([t(sidebar.key), '`', '²']) to toggle sidebar
(closes #5663)
This commit is contained in:
@@ -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]))
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user