diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index 7c1d72ee2..a18b0f10c 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -12,7 +12,6 @@ export var uiCmd = function (code) { if (detected.os === 'win') { if (code === '⌘⇧Z') return 'Ctrl+Y'; - if (code === '⌃⌘F') return 'F11'; } var result = '', diff --git a/modules/ui/full_screen.js b/modules/ui/full_screen.js index 90e7cb25a..ea1e35423 100644 --- a/modules/ui/full_screen.js +++ b/modules/ui/full_screen.js @@ -1,6 +1,7 @@ import * as d3 from 'd3'; import { d3keybinding } from '../lib/d3.keybinding.js'; import { uiCmd } from './cmd'; +import { utilDetect } from '../util/detect'; export function uiFullScreen(context) { @@ -73,8 +74,9 @@ export function uiFullScreen(context) { // button.append('span') // .attr('class', 'icon full-screen'); - keybinding - .on([uiCmd('⌃⌘F'), 'f11'], fullScreen); + var detected = utilDetect(); + var keys = detected.os === 'mac' ? [uiCmd('⌃⌘F'), 'f11'] : ['f11']; + keybinding.on(keys, fullScreen); d3.select(document) .call(keybinding); diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index 7a83c7db8..64eb50ecb 100644 --- a/modules/ui/shortcuts.js +++ b/modules/ui/shortcuts.js @@ -151,8 +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 if (detected.os === 'mac' && d.text === 'shortcuts.browsing.display_options.fullscreen') { + return ["⌃", "⌘"]; } else { return d.modifiers; } @@ -175,19 +175,14 @@ export function uiShortcuts() { shortcutKeys .selectAll('kbd.shortcut') .data(function (d) { + var arr = d.shortcuts; if (detected.os === 'win' && d.text === 'shortcuts.editing.commands.redo') { - return [{ - shortcut: 'Y', - separator: d.separator - }]; - } else if (detected.os === 'win' && d.text === 'shortcuts.browsing.display_options.fullscreen') { - return [{ - shortcut: 'F11', - separator: d.separator - }]; + arr = ['Y']; + } else if (detected.os === 'mac' && d.text === 'shortcuts.browsing.display_options.fullscreen') { + arr = ['F', 'F11']; } - return d.shortcuts.map(function(s) { + return arr.map(function(s) { return { shortcut: s, separator: d.separator