fix: slash command does not work (#207)

This commit is contained in:
lencx
2023-01-15 18:02:23 +08:00
parent 4f03487a53
commit a798a8a784
9 changed files with 84 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
// *** Core Script - DALL·E 2 ***
$(function () {
function init() {
document.addEventListener("click", (e) => {
const origin = e.target.closest("a");
if (!origin || !origin.target) return;
@@ -28,4 +28,13 @@ $(function () {
searchInput.value = query;
}
}, 200)
})
}
if (
document.readyState === "complete" ||
document.readyState === "interactive"
) {
init();
} else {
document.addEventListener("DOMContentLoaded", init);
}