Add email service and settings
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Controller } from "@hotwired/stimulus"
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = [ "resetPasswordButton", "currentPasswordField" ]
|
||||
static values = { validationFailed: Boolean }
|
||||
|
||||
connect () {
|
||||
if (this.validationFailedValue) return;
|
||||
|
||||
this.element.querySelectorAll(".initial-hidden").forEach(el => {
|
||||
el.classList.add("hidden");
|
||||
})
|
||||
this.element.querySelectorAll(".initial-visible").forEach(el => {
|
||||
el.classList.remove("hidden");
|
||||
})
|
||||
}
|
||||
|
||||
showPasswordReset () {
|
||||
this.element.querySelectorAll(".initial-visible").forEach(el => {
|
||||
el.classList.add("hidden");
|
||||
})
|
||||
this.element.querySelectorAll(".initial-hidden").forEach(el => {
|
||||
el.classList.remove("hidden");
|
||||
})
|
||||
this.currentPasswordFieldTarget.select();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user