mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-04 08:28:17 +08:00
Protect against script injection
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
import KeyboardShortcut from "./KeyboardShortcut";
|
||||
import KeyboardShortcut from "./KeyboardShortcut"
|
||||
import Configuration from "../Configuration"
|
||||
|
||||
|
||||
export default class KeyvoardCanc extends KeyboardShortcut {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {HTMLElement} target
|
||||
* @param {import("../Blueprint").default} blueprint
|
||||
* @param {OBject} options
|
||||
*/
|
||||
constructor(target, blueprint, options = {}) {
|
||||
options.key = "Delete"
|
||||
options = KeyboardShortcut.keyOptionsParse(options, Configuration.deleteNodesKeyboardKey)
|
||||
super(target, blueprint, options)
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,16 @@ export default class KeyboardShortcut extends Context {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {String} keyString
|
||||
* @returns {Object}
|
||||
*/
|
||||
static keyOptionsParse(options, keyString) {
|
||||
options.key = keyString
|
||||
return options
|
||||
}
|
||||
|
||||
blueprintFocused() {
|
||||
document.addEventListener("keydown", this.keyDownHandler)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user