Skip to content

Commit

Permalink
fix for help on macs
Browse files Browse the repository at this point in the history
  • Loading branch information
ondras committed Feb 21, 2020
1 parent 15c77f4 commit 74d091b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions my-mind.js
Original file line number Diff line number Diff line change
Expand Up @@ -4032,7 +4032,7 @@ MM.UI.Help = function() {
121: "F10",
"-": "−"
};

this._build();
}

Expand Down Expand Up @@ -4088,6 +4088,7 @@ MM.UI.Help.prototype._buildRow = function(table, commandName) {

for (var i=1;i<arguments.length;i++) {
var command = MM.Command[arguments[i]];
if (!command) { continue; }
labels.push(command.label);
keys = keys.concat(command.keys.map(this._formatKey, this));
}
Expand All @@ -4102,9 +4103,9 @@ MM.UI.Help.prototype._formatKey = function(key) {
if (key.ctrlKey) { str += "Ctrl+"; }
if (key.altKey) { str += "Alt+"; }
if (key.shiftKey) { str += "Shift+"; }
if (key.charCode) {
if (key.charCode) {
var ch = String.fromCharCode(key.charCode);
str += this._map[ch] || ch.toUpperCase();
str += this._map[ch] || ch.toUpperCase();
}
if (key.keyCode) { str += this._map[key.keyCode] || String.fromCharCode(key.keyCode); }
return str;
Expand Down
7 changes: 4 additions & 3 deletions src/ui.help.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MM.UI.Help = function() {
121: "F10",
"-": "&minus;"
};

this._build();
}

Expand Down Expand Up @@ -87,6 +87,7 @@ MM.UI.Help.prototype._buildRow = function(table, commandName) {

for (var i=1;i<arguments.length;i++) {
var command = MM.Command[arguments[i]];
if (!command) { continue; }
labels.push(command.label);
keys = keys.concat(command.keys.map(this._formatKey, this));
}
Expand All @@ -101,9 +102,9 @@ MM.UI.Help.prototype._formatKey = function(key) {
if (key.ctrlKey) { str += "Ctrl+"; }
if (key.altKey) { str += "Alt+"; }
if (key.shiftKey) { str += "Shift+"; }
if (key.charCode) {
if (key.charCode) {
var ch = String.fromCharCode(key.charCode);
str += this._map[ch] || ch.toUpperCase();
str += this._map[ch] || ch.toUpperCase();
}
if (key.keyCode) { str += this._map[key.keyCode] || String.fromCharCode(key.keyCode); }
return str;
Expand Down

0 comments on commit 74d091b

Please sign in to comment.