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:
Bryan Housel
2017-06-09 22:37:44 -04:00
parent d20e053057
commit 8c2775276e
4 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -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"],
+2
View File
@@ -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'),
+1 -2
View File
@@ -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);
+7
View File
@@ -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) {