summaryrefslogtreecommitdiffstats
path: root/webapp/utils/utils.jsx
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-07-06 08:50:43 -0400
committerChristopher Speller <crspeller@gmail.com>2016-07-06 08:50:43 -0400
commit96ca098f4bcb9d6cf1a0465a8aeade2db9294e1d (patch)
tree9668463df4cff2d7dd463a92d8ee8906f7797243 /webapp/utils/utils.jsx
parent6c33350f5c7e58ac45d7300c035dd58ecf6b3330 (diff)
downloadchat-96ca098f4bcb9d6cf1a0465a8aeade2db9294e1d.tar.gz
chat-96ca098f4bcb9d6cf1a0465a8aeade2db9294e1d.tar.bz2
chat-96ca098f4bcb9d6cf1a0465a8aeade2db9294e1d.zip
PLT-3473 Made shortcuts only work for CMD on OSX (#3479)
* checked for CMD key * changed method of checking
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r--webapp/utils/utils.jsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx
index 65a203ab0..ee2c4099f 100644
--- a/webapp/utils/utils.jsx
+++ b/webapp/utils/utils.jsx
@@ -32,6 +32,14 @@ export function cleanUpUrlable(input) {
return cleaned;
}
+export function isMac() {
+ return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
+}
+
+export function cmdOrCtrlPressed(e) {
+ return (isMac() && e.metaKey) || (!isMac() && e.ctrlKey);
+}
+
export function isChrome() {
if (navigator.userAgent.indexOf('Chrome') > -1) {
return true;