From 645dcebbfe242850a1d1b761b25481ce8e2ff692 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 7 Feb 2013 18:09:28 -0500 Subject: [PATCH] Use platform-specific mod keys, refs #676 --- js/id/id.js | 1 + js/id/ui.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/js/id/id.js b/js/id/id.js index e6396b491..f1d7d853d 100644 --- a/js/id/id.js +++ b/js/id/id.js @@ -125,6 +125,7 @@ iD.detect = function() { else if (nav('Mac')) browser.os = 'mac'; else if (nav('X11')) browser.os = 'linux'; else if (nav('Linux')) browser.os = 'linux'; + else browser.os = 'win'; return browser; }; diff --git a/js/id/ui.js b/js/id/ui.js index 37874b25f..f18e0ef0c 100644 --- a/js/id/ui.js +++ b/js/id/ui.js @@ -210,14 +210,20 @@ iD.ui = function(context) { } } + var mod = { + 'mac': '⌘', + 'win': 'Ctrl', + 'linux': 'Ctrl' + }[iD.detect().os]; + limiter.select('#undo') .classed('disabled', !undo) - .attr('data-original-title', hintprefix('⌘ + Z', undo || t('nothing_to_undo'))) + .attr('data-original-title', hintprefix(mod + ' + Z', undo || t('nothing_to_undo'))) .call(refreshTooltip); limiter.select('#redo') .classed('disabled', !redo) - .attr('data-original-title', hintprefix('⌘ + ⇧ + Z', redo || t('nothing_to_redo'))) + .attr('data-original-title', hintprefix(mod + ' + ⇧ + Z', redo || t('nothing_to_redo'))) .call(refreshTooltip); });