mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user