mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 13:18:15 +02:00
Fix fullscreen shortcut on Mac, add F11 to the shortcuts screen
(see https://github.com/openstreetmap/iD/issues/4081#issuecomment-307475720)
This commit is contained in:
+2
-2
@@ -53,8 +53,8 @@
|
||||
"shortcuts": ["F"],
|
||||
"text": "shortcuts.browsing.display_options.map_data"
|
||||
}, {
|
||||
"modifiers": ["⌘", "⇧"],
|
||||
"shortcuts": ["F"],
|
||||
"modifiers": ["⌃", "⌘"],
|
||||
"shortcuts": ["F", "F11"],
|
||||
"text": "shortcuts.browsing.display_options.fullscreen"
|
||||
}, {
|
||||
"shortcuts": ["W"],
|
||||
|
||||
@@ -12,6 +12,7 @@ export var uiCmd = function (code) {
|
||||
|
||||
if (detected.os === 'win') {
|
||||
if (code === '⌘⇧Z') return 'Ctrl+Y';
|
||||
if (code === '⌃⌘F') return 'F11';
|
||||
}
|
||||
|
||||
var result = '',
|
||||
@@ -45,6 +46,7 @@ uiCmd.display = function(code) {
|
||||
'⌘': mac ? '⌘ ' + t('shortcuts.key.cmd') : t('shortcuts.key.ctrl'),
|
||||
'⇧': mac ? '⇧ ' + t('shortcuts.key.shift') : t('shortcuts.key.shift'),
|
||||
'⌥': mac ? '⌥ ' + t('shortcuts.key.option') : t('shortcuts.key.alt'),
|
||||
'⌃': mac ? '⌃ ' + t('shortcuts.key.ctrl') : t('shortcuts.key.ctrl'),
|
||||
'⌫': mac ? '⌫ ' + t('shortcuts.key.delete') : t('shortcuts.key.backspace'),
|
||||
'⌦': mac ? '⌦ ' + t('shortcuts.key.del') : t('shortcuts.key.del'),
|
||||
'↖': mac ? '↖ ' + t('shortcuts.key.pgup') : t('shortcuts.key.pgup'),
|
||||
|
||||
@@ -74,8 +74,7 @@ export function uiFullScreen(context) {
|
||||
// .attr('class', 'icon full-screen');
|
||||
|
||||
keybinding
|
||||
.on('f11', fullScreen)
|
||||
.on(uiCmd('⌘⇧F'), fullScreen);
|
||||
.on([uiCmd('⌃⌘F'), 'f11'], fullScreen);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
|
||||
@@ -151,6 +151,8 @@ export function uiShortcuts() {
|
||||
.data(function (d) {
|
||||
if (detected.os === 'win' && d.text === 'shortcuts.editing.commands.redo') {
|
||||
return ['⌘'];
|
||||
} else if (detected.os === 'win' && d.text === 'shortcuts.browsing.display_options.fullscreen') {
|
||||
return [];
|
||||
} else {
|
||||
return d.modifiers;
|
||||
}
|
||||
@@ -178,6 +180,11 @@ export function uiShortcuts() {
|
||||
shortcut: 'Y',
|
||||
separator: d.separator
|
||||
}];
|
||||
} else if (detected.os === 'win' && d.text === 'shortcuts.browsing.display_options.fullscreen') {
|
||||
return [{
|
||||
shortcut: 'F11',
|
||||
separator: d.separator
|
||||
}];
|
||||
}
|
||||
|
||||
return d.shortcuts.map(function(s) {
|
||||
|
||||
Reference in New Issue
Block a user