fix turbo on dashboard + optimize a few more things.

This commit is contained in:
KingKDot
2026-07-13 21:54:21 -05:00
parent b08d8ba028
commit feb712e2de
16 changed files with 194 additions and 83 deletions
@@ -0,0 +1,17 @@
import { Controller } from "/vendor/hotwired/stimulus.js";
export default class extends Controller {
static targets = ["input", "icon"];
toggle(event) {
event.preventDefault();
const revealing = this.inputTarget.type === "password";
this.inputTarget.type = revealing ? "text" : "password";
event.currentTarget.setAttribute("aria-pressed", String(revealing));
event.currentTarget.setAttribute("aria-label", revealing ? "Hide value" : "Show value");
if (this.hasIconTarget) {
this.iconTarget.classList.toggle("fa-eye", !revealing);
this.iconTarget.classList.toggle("fa-eye-slash", revealing);
}
}
}