UNPKG

altinn-designsystem

Version:

Altinn Design system based on Pattern Lab.

28 lines (25 loc) 844 B
function showPassword(src, target) { var pwd = $('#' + target); if (pwd.attr('type') === 'text') { pwd.attr('type', 'password'); $(src).children('.hide-password-text').hide(); $(src).children('.show-password-text').show(); } else { pwd.attr('type', 'text'); $(src).children('.hide-password-text').show(); $(src).children('.show-password-text').hide(); setTimeout(function() { pwd.attr('type', 'password'); $(src).children('.hide-password-text').hide(); $(src).children('.show-password-text').show(); }, 15000); } } function setVisibility(passwordField, showPasswordId) { var password = $(passwordField); if (password.val().length > 0) { $('#' + showPasswordId).removeClass('d-none'); } else { $('#' + showPasswordId).addClass('d-none'); } }