- Description:
JS module for toggling the sensitive input visibility (e.g. passwords, keys).
- Source:
- Copyright:
- 2023 David Woloszyn
- 2023 David Woloszyn
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
JS module for toggling the sensitive input visibility (e.g. passwords, keys).
Methods
(inner) handleButtonInteraction(event)
- Description:
Handle events trigger by interacting with the toggle button.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | The button event. |
(inner) handleScreenResizing()
- Description:
Handle events trigger by resizing the screen.
- Source:
(inner) init(elementId, isSmallScreensOnly)
- Description:
Entrypoint of the js.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
elementId |
String | Form button element. |
isSmallScreensOnly |
boolean | Is this for small screens only? |
(inner) registerListenerEvents()
- Description:
Register event listeners.
- Source:
(inner) renderSensitiveToggle(sensitiveInput)
- Description:
Render the new input html with toggle button and update the incoming html.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
sensitiveInput |
HTMLElement | HTML element for the sensitive input. |
(inner) toggleSensitiveVisibility(sensitiveInput, toggleButton, force)
- Description:
Toggle the sensitive input visibility and its associated icon.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
sensitiveInput |
HTMLInputElement | The sensitive input element. |
toggleButton |
HTMLElement | The toggle button. |
force |
boolean | Force the input back to password type. |