DEV: add @submit hook for ace editor (#28010)

* DEV: add @commit hook for ace editor

Add @commit hook to AceEditor to handle "save and run" in Data Explorer
This commit is contained in:
锦心 2024-07-22 15:53:30 +08:00 committed by GitHub
parent fb7cc2d375
commit 0eeebeb6b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -136,6 +136,15 @@ export default class AceEditor extends Component {
bindKey: { mac: "cmd-s", win: "ctrl-s" },
});
}
if (this.submit) {
editor.commands.addCommand({
name: "submit",
exec: () => {
this.submit();
},
bindKey: { mac: "cmd-enter", win: "ctrl-enter" },
});
}
editor.on("blur", () => {
this.warnSCSSDeprecations();