mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
UPD: add show pass JS
This commit is contained in:
parent
aa8df35672
commit
f38d186a09
@ -4,6 +4,7 @@ namespace A2nt\CMSNiceties\Extensions;
|
||||
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Security\MemberAuthenticator\MemberLoginForm;
|
||||
use SilverStripe\View\Requirements;
|
||||
|
||||
class SiteMemberLoginForm extends MemberLoginForm
|
||||
{
|
||||
@ -22,6 +23,7 @@ class SiteMemberLoginForm extends MemberLoginForm
|
||||
$fields = $this->Fields();
|
||||
$actions = $this->Actions();
|
||||
|
||||
Requirements::customScript('document.querySelector(".field-password__show-password").addEventListener("click",function(e){e.preventDefault();var p = document.querySelector(\'[name="Password"]\');if(p.getAttribute("type")==="password"){var attr="text";}else{var attr="password"}p.setAttribute("type", attr);});');
|
||||
$email = $fields->fieldByName('Email');
|
||||
if ($email) {
|
||||
$email
|
||||
|
Loading…
Reference in New Issue
Block a user