1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Remove d3 from keyboard.js

This commit is contained in:
Nick O'Leary 2022-08-05 21:19:45 +01:00
parent 30ea300f65
commit c24d7fafa9
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9

View File

@ -298,21 +298,21 @@ RED.keyboard = (function() {
return resolveKeyEvent(evt);
}
}
d3.select(window).on("keydown",function() {
document.addEventListener("keydown", function(event) {
if (!handlersActive) {
return;
}
if (metaKeyCodes[d3.event.keyCode]) {
if (metaKeyCodes[event.keyCode]) {
return;
}
var handler = resolveKeyEvent(d3.event);
var handler = resolveKeyEvent(event);
if (handler && handler.ondown) {
if (typeof handler.ondown === "string") {
RED.actions.invoke(handler.ondown);
} else {
handler.ondown();
}
d3.event.preventDefault();
event.preventDefault();
}
});