Skip to content

Conversation

@vladanost
Copy link
Contributor

Description

Related to #3755
Detecting Mac when displaying editor mode toggle shortcut.

How Has This Been Tested?

Tested on Mac and Linux.

Types of changes

New feature (non-breaking change which adds functionality)

@@ -1,6 +1,10 @@
// eslint-disable-next-line
const isMac = navigator.platform.toUpperCase().indexOf( 'MAC' ) >= 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could do window.navigator to avoid the eslint issue?

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@youknowriad youknowriad merged commit b407ccc into WordPress:master Dec 28, 2017
@vladanost vladanost deleted the try/detect-platform-for-editor-mode-toggle-shortcut-display branch December 28, 2017 13:55
@aduth
Copy link
Member

aduth commented Jan 3, 2018

If this file is consumed by the KeyboardShortcuts (or Mousetrap generally) we can use the mod keyword to automatically toggle Command / Ctrl.

https://craig.is/killing/mice

@youknowriad
Copy link
Contributor

@aduth This is for "display" purpose. To show the actual shortcut in the ellipsis menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants