Remove unneeded stuff
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled

This commit is contained in:
Dan Milne
2025-11-04 18:47:31 +11:00
parent fb14ce032f
commit e9b1995e89

View File

@@ -3,9 +3,6 @@ import { Controller } from "@hotwired/stimulus"
// Generic modal controller for showing/hiding modal dialogs
export default class extends Controller {
static targets = ["dialog"]
static values = {
refreshOnClose: { type: Boolean, default: false }
}
show(event) {
// If called from a button with data-modal-id, find and show that modal
@@ -14,8 +11,6 @@ export default class extends Controller {
const modal = document.getElementById(modalId);
if (modal) {
modal.classList.remove("hidden");
// Store the refresh preference from the button
this.refreshOnCloseValue = event.currentTarget?.dataset?.refreshOnClose === "true";
}
} else if (this.hasDialogTarget) {
// Otherwise show the dialog target
@@ -36,11 +31,6 @@ export default class extends Controller {
} else {
this.element.classList.add("hidden");
}
// Refresh page if requested
if (this.refreshOnCloseValue) {
window.location.reload();
}
}
// Close modal when clicking backdrop