mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 04:36:21 +00:00
fix: htmx usa value para el evento #16714
This commit is contained in:
parent
e9e55945d9
commit
434e1311f2
2 changed files with 5 additions and 5 deletions
|
@ -39,13 +39,13 @@ export default class extends Controller {
|
|||
|
||||
if (!this.element.getAttributeNames().some(x => x.startsWith("hx-"))) this.element.submit();
|
||||
|
||||
window.dispatchEvent(new CustomEvent("notification:show", { detail: { id: this.submittingIdValue } }));
|
||||
window.dispatchEvent(new CustomEvent("notification:show", { detail: { value: this.submittingIdValue } }));
|
||||
} else {
|
||||
event?.stopPropagation();
|
||||
|
||||
this.element.classList.add("was-validated");
|
||||
|
||||
window.dispatchEvent(new CustomEvent("notification:show", { detail: { id: this.invalidIdValue } }));
|
||||
window.dispatchEvent(new CustomEvent("notification:show", { detail: { value: this.invalidIdValue } }));
|
||||
}
|
||||
|
||||
this.submitting = false;
|
||||
|
|
|
@ -19,8 +19,8 @@ export default class extends Controller {
|
|||
* actual, se oculta.
|
||||
*/
|
||||
show(event = undefined) {
|
||||
if (event?.detail?.id !== this.element.id) {
|
||||
this.hide({ detail: { id: this.element.id } });
|
||||
if (event?.detail?.value !== this.element.id) {
|
||||
this.hide({ detail: { value: this.element.id } });
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ export default class extends Controller {
|
|||
}
|
||||
|
||||
hide(event = undefined) {
|
||||
if (event?.detail?.id !== this.element.id) return;
|
||||
if (event?.detail?.value !== this.element.id) return;
|
||||
|
||||
this.element.classList.remove(...this.showClasses);
|
||||
this.element.classList.add(...this.hideClasses);
|
||||
|
|
Loading…
Reference in a new issue