mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
* WIP * WIP * WIP * WIP * WIP * WIP * WIP * format * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * fix conflict * fix conflict * chore: run rubocop * fix test * update PWA logo * fix tests * chore: lint * fix test * Refactor: Remove duplicate data attribute in activity partial and add chat form rendering in chats index --------- Co-authored-by: Josh Pigford <josh@joshpigford.com>
19 lines
517 B
JavaScript
19 lines
517 B
JavaScript
import { Controller } from "@hotwired/stimulus";
|
|
|
|
// Connects to data-controller="password-visibility"
|
|
export default class extends Controller {
|
|
static targets = ["input", "showIcon", "hideIcon"];
|
|
|
|
connect() {
|
|
this.hideIconTarget.classList.add("hidden");
|
|
}
|
|
|
|
toggle() {
|
|
const input = this.inputTarget;
|
|
const type = input.type === "password" ? "text" : "password";
|
|
input.type = type;
|
|
|
|
this.showIconTarget.classList.toggle("hidden");
|
|
this.hideIconTarget.classList.toggle("hidden");
|
|
}
|
|
}
|