summaryrefslogtreecommitdiff
path: root/html/assets/js/forms/password.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/assets/js/forms/password.js')
-rw-r--r--html/assets/js/forms/password.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/html/assets/js/forms/password.js b/html/assets/js/forms/password.js
new file mode 100644
index 0000000..c0ccbef
--- /dev/null
+++ b/html/assets/js/forms/password.js
@@ -0,0 +1,15 @@
+$$plugins.define('password', function (element, options) {
+ var input = element.previousElementSibling;
+
+ element.addEventListener("click", function (e) {
+ e.preventDefault();
+ if (input.type === 'password') {
+ input.type = 'text';
+ element.classList.add('disabled');
+ }
+ else {
+ input.type = 'password';
+ element.classList.remove('disabled');
+ }
+ });
+});