Password toggle component.
Classes
Methods
(static) .create(formItem) → {PasswordToggle}
Creates and registers a passwordToggle.
Parameters:
Name | Type | Description |
---|---|---|
formItem |
Node | the form element |
Returns:
- the PasswordToggle object
- Type
- PasswordToggle
Example
UCASDesignFramework.passwordToggle.create($myFormItem)
(static) .destroy(formItem)
Parameters:
Name | Type | Description |
---|---|---|
formItem |
Node | the form element |
Example
UCASDesignFramework.passwordToggle.destroy($myFormItem)
(static) .init(contextopt, selectoropt) → {Boolean}
Initialises any form items it finds that have a data-password-toggle attribute
set to true to allow the password to toggle between password and text types.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
context |
Node |
<optional> |
document | context to limit the selector |
selector |
String |
<optional> |
.form-item [data-password-toggle="true"] | a valid CSS selector for the password toggle data attribute |
Returns:
- true for success
- Type
- Boolean
Example
UCASDesignFramework.passwordToggle.init()