diff --git a/Editor.js b/Editor.js index a8fda1d..3dc952a 100644 --- a/Editor.js +++ b/Editor.js @@ -194,6 +194,18 @@ class Editor extends List { } return; + case 'u': + history.back(); + e.stopPropagation(); + e.preventDefault(); + return; + + case 'U': + history.forward(); + e.stopPropagation(); + e.preventDefault(); + return; + case '?': if (this.addHelpAfter()) { e.stopPropagation(); diff --git a/EditorHelp.js b/EditorHelp.js index f3e3ea5..561f105 100644 --- a/EditorHelp.js +++ b/EditorHelp.js @@ -53,6 +53,16 @@ class EditorHelp extends EditorEntryBase { this.addLine(); this.addKey('f'); this.addText('Flip link '); + + this.addLine(); + this.addKey('u'); + this.addText('Undo '); + + this.addLine(); + this.addKey('⇧'); + this.addText('+'); + this.addKey('u'); + this.addText('Redo '); } addLine() { diff --git a/EditorLabel.js b/EditorLabel.js index a5f54fd..bb0a376 100644 --- a/EditorLabel.js +++ b/EditorLabel.js @@ -13,7 +13,7 @@ class EditorLabel extends EditorEntryBase { this.listen(this.input_, 'blur', (e) => this.onBlur(e)); this.elem_.appendChild(this.input_); - this.lastSnapshotLabel_ = null; + this.lastSnapshotLabel_ = ''; } afterDomAdd() { diff --git a/EditorNode.js b/EditorNode.js index 748ca23..5d20ac4 100644 --- a/EditorNode.js +++ b/EditorNode.js @@ -12,7 +12,7 @@ class EditorNode extends EditorEntryBase { this.listen(this.input_, 'blur', (e) => this.onBlur(e)); this.elem_.appendChild(this.input_); - this.lastSnapshotLabel_ = null; + this.lastSnapshotLabel_ = ''; if (label) { this.setLabel(label);