Use platform-specific mod keys, refs #676

This commit is contained in:
Tom MacWright
2013-02-07 18:09:28 -05:00
parent adbcfbd969
commit 645dcebbfe
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -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;
};
+8 -2
View File
@@ -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);
});