mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Only offer the ⌃⌘F shortcut for fullscreen if the user is on a mac
This commit is contained in:
@@ -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 = '',
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user