Do preventDefault behavior on ⌘Z and ⌘⇧Z

This prevents some instances of https://bugs.webkit.org/show_bug.cgi?id=117092,
and generally we don't ever want the default undo
behavior when these handlers are triggered.
This commit is contained in:
John Firebaugh
2013-05-31 14:29:57 -07:00
parent 0724e204e8
commit a51e932800
+2 -2
View File
@@ -30,8 +30,8 @@ iD.ui.UndoRedo = function(context) {
.attr('class', function(d) { return 'icon ' + d.id; });
var keybinding = d3.keybinding('undo')
.on(commands[0].cmd, commands[0].action)
.on(commands[1].cmd, commands[1].action);
.on(commands[0].cmd, function() { d3.event.preventDefault(); commands[0].action(); })
.on(commands[1].cmd, function() { d3.event.preventDefault(); commands[1].action(); });
d3.select(document)
.call(keybinding);