Compare commits

..
Author SHA1 Message Date
imperosol aedfbf948e fix: htmx:after:swap was still using old syntax 2026-09-20 23:07:09 +02:00
5 changed files with 10 additions and 11 deletions
@@ -123,14 +123,14 @@ document.addEventListener("alpine:init", () => {
onRefillingSuccess(event: CustomEvent) { onRefillingSuccess(event: CustomEvent) {
if ( if (
event.type !== "htmx:after-swap" || event.type !== "htmx:after:swap" ||
event.detail.failed || event.detail.ctx.response.status !== 200 ||
event.detail.elt.querySelector(".errorlist") event.detail.ctx.target.querySelector(".errorlist")
) { ) {
return; return;
} }
this.customerBalance += Number.parseFloat( this.customerBalance += Number.parseFloat(
(event.detail.target.querySelector("#id_amount") as HTMLInputElement).value, (event.detail.ctx.target.querySelector("#id_amount") as HTMLInputElement).value,
); );
document.getElementById("selling-accordion")?.setAttribute("open", ""); document.getElementById("selling-accordion")?.setAttribute("open", "");
this.codeField?.widget.focus(); this.codeField?.widget.focus();
@@ -62,7 +62,8 @@
} }
form { form {
margin: 0; margin-top: .5rem;
margin-bottom: .5rem;
} }
} }
@@ -186,7 +186,7 @@
{% if refilling_fragment %} {% if refilling_fragment %}
<div <div
class="accordion-content" class="accordion-content"
@htmx:after-swap="onRefillingSuccess" @htmx:after:swap="onRefillingSuccess"
> >
{{ refilling_fragment }} {{ refilling_fragment }}
</div> </div>
@@ -4,8 +4,6 @@
hx-swap="outerHTML" hx-swap="outerHTML"
> >
{% csrf_token %} {% csrf_token %}
<div class="margin-bottom">
{{ form.as_p() }} {{ form.as_p() }}
</div> <input type="submit" value="{% trans %}Go{% endtrans %}"/>
<input type="submit" class="btn btn-blue" value="{% trans %}Go{% endtrans %}"/>
</form> </form>
@@ -60,7 +60,7 @@
</p> </p>
<br> <br>
{% if settings.SITH_EBOUTIC_CB_ENABLED %} {% if settings.SITH_EBOUTIC_CB_ENABLED %}
<div @htmx:after-request="fill"> <div @htmx:after:request="fill">
{{ billing_infos_form }} {{ billing_infos_form }}
</div> </div>
{% endif %} {% endif %}