Skip to content

Commit

Permalink
fix(all): fix compiling of all.js (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispymm authored Sep 25, 2024
1 parent dc0c424 commit 5ee079b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/moj/components/password-reveal/password-reveal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PasswordReveal = function(element) {
MOJFrontend.PasswordReveal = function(element) {
this.el = element;
var $el = $(this.el)

Expand All @@ -14,13 +14,13 @@ PasswordReveal = function(element) {
this.createButton();
};

PasswordReveal.prototype.createButton = function() {
MOJFrontend.PasswordReveal.prototype.createButton = function() {
this.button = $('<button type="button" class="govuk-button govuk-button--secondary moj-password-reveal__button">Show <span class="govuk-visually-hidden">password</span></button>');
this.container.append(this.button);
this.button.on('click', $.proxy(this, 'onButtonClick'));
};

PasswordReveal.prototype.onButtonClick = function() {
MOJFrontend.PasswordReveal.prototype.onButtonClick = function() {
if (this.el.type === 'password') {
this.el.type = 'text';
this.button.html('Hide <span class="govuk-visually-hidden">password</span>');
Expand All @@ -30,4 +30,3 @@ PasswordReveal.prototype.onButtonClick = function() {
}
};

MOJFrontend.PasswordReveal = PasswordReveal

0 comments on commit 5ee079b

Please sign in to comment.