chore: update templ and templui
This commit is contained in:
parent
b5d195baea
commit
61eaa268ab
89 changed files with 25776 additions and 8231 deletions
25
assets/js/input.js
Normal file
25
assets/js/input.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
const button = e.target.closest('[data-tui-input-toggle-password]');
|
||||
if (!button) return;
|
||||
|
||||
const inputId = button.getAttribute('data-tui-input-toggle-password');
|
||||
const input = document.getElementById(inputId);
|
||||
if (!input) return;
|
||||
|
||||
const iconOpen = button.querySelector('.icon-open');
|
||||
const iconClosed = button.querySelector('.icon-closed');
|
||||
|
||||
if (input.type === 'password') {
|
||||
input.type = 'text';
|
||||
if (iconOpen) iconOpen.classList.add('hidden');
|
||||
if (iconClosed) iconClosed.classList.remove('hidden');
|
||||
} else {
|
||||
input.type = 'password';
|
||||
if (iconOpen) iconOpen.classList.remove('hidden');
|
||||
if (iconClosed) iconClosed.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Add table
Add a link
Reference in a new issue