mirror of
https://github.com/bitwarden/web
synced 2025-12-19 09:43:33 +00:00
rename "vault" to "web"
This commit is contained in:
27
src/Web/wwwroot/app/directives/passwordViewerDirective.js
Normal file
27
src/Web/wwwroot/app/directives/passwordViewerDirective.js
Normal file
@@ -0,0 +1,27 @@
|
||||
angular
|
||||
.module('bit.directives')
|
||||
|
||||
.directive('passwordViewer', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attr) {
|
||||
var passwordViewer = attr.passwordViewer;
|
||||
if (!passwordViewer) {
|
||||
return;
|
||||
}
|
||||
|
||||
element.onclick = function (event) { };
|
||||
element.on('click', function (event) {
|
||||
var passwordElement = $(passwordViewer);
|
||||
if (passwordElement && passwordElement.attr('type') == 'password') {
|
||||
element.removeClass('fa-eye').addClass('fa-eye-slash');
|
||||
passwordElement.attr('type', 'text');
|
||||
}
|
||||
else if (passwordElement && passwordElement.attr('type') == 'text') {
|
||||
element.removeClass('fa-eye-slash').addClass('fa-eye');
|
||||
passwordElement.attr('type', 'password');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user