mirror of
https://github.com/sigmasternchen/mobmash.click
synced 2025-03-15 08:09:02 +00:00
fix: img-preload doesn't support data prefix + running cursor fix on load doesn't work
This commit is contained in:
parent
27ac8195b3
commit
be991b99fc
2 changed files with 7 additions and 2 deletions
|
@ -4,7 +4,12 @@ console.log("module loaded");
|
|||
|
||||
htmx.defineExtension('img-preload', {
|
||||
onEvent: (name, event) => {
|
||||
if ((event?.target?.getAttribute("hx-ext") ?? "") !== "img-preload") {
|
||||
if (
|
||||
(
|
||||
event?.target?.getAttribute("hx-ext") ??
|
||||
event?.target?.getAttribute("data-hx-ext" ?? "")
|
||||
) !== "img-preload"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<input type="hidden" name="csrfToken" value="<?= $csrfToken ?>">
|
||||
<h2><?= $mob["name"]; ?></h2>
|
||||
<img alt="<?= $mob["name"]; ?>" src="/images/mobs/<?= $mob["image"] ?? "_placeholder.png"; ?>">
|
||||
<script>document.getElementById("form-<?= $side ?>").style.cursor = "pointer";</script>
|
||||
<script>setTimeout(() => { document.getElementById("form-<?= $side ?>").style.cursor = "pointer"; }, 1);</script>
|
||||
<noscript><input class="fallback" type="submit" value="<?= $mob["name"]; ?>"></noscript>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue