summaryrefslogtreecommitdiff
path: root/public/assets/js/forms/password.js
blob: c0ccbef5ae72885d840be1229a39408e288df39a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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');
        }
    });
});