diff --git a/app/scripts/templates/delete_account.mustache b/app/scripts/templates/delete_account.mustache index 988ee9a98..a15fb0bec 100644 --- a/app/scripts/templates/delete_account.mustache +++ b/app/scripts/templates/delete_account.mustache @@ -13,8 +13,14 @@ -
- +
+ + + +
diff --git a/app/scripts/templates/settings.mustache b/app/scripts/templates/settings.mustache index 19c3a4428..2fe37ab69 100644 --- a/app/scripts/templates/settings.mustache +++ b/app/scripts/templates/settings.mustache @@ -10,12 +10,24 @@

{{#t}}You are signed in as:{{/t}}
{{ email }}

-
+
+ + +
-
+
+ + +
diff --git a/app/scripts/views/delete_account.js b/app/scripts/views/delete_account.js index 9ab2ade8c..46e4e2af7 100644 --- a/app/scripts/views/delete_account.js +++ b/app/scripts/views/delete_account.js @@ -5,12 +5,14 @@ 'use strict'; define([ + 'underscore', 'views/base', 'stache!templates/delete_account', 'lib/session', - 'lib/fxa-client' + 'lib/fxa-client', + 'lib/password-mixin' ], -function (BaseView, Template, Session, FxaClient) { +function (_, BaseView, Template, Session, FxaClient, PasswordMixin) { var View = BaseView.extend({ // user must be authenticated to delete their account mustAuth: true, @@ -23,7 +25,8 @@ function (BaseView, Template, Session, FxaClient) { 'keyup #back': 'backOnEnter', 'submit form': 'deleteAccount', 'keyup input': 'enableButtonWhenValid', - 'change input': 'enableButtonWhenValid' + 'change input': 'enableButtonWhenValid', + 'change .show-password': 'onPasswordVisibilityChange' }, deleteAccount: function (event) { @@ -62,6 +65,8 @@ function (BaseView, Template, Session, FxaClient) { } }); + _.extend(View.prototype, PasswordMixin); + return View; }); diff --git a/app/scripts/views/settings.js b/app/scripts/views/settings.js index 67e3feb7d..21d0f6ae2 100644 --- a/app/scripts/views/settings.js +++ b/app/scripts/views/settings.js @@ -9,9 +9,10 @@ define([ 'views/base', 'stache!templates/settings', 'lib/fxa-client', - 'lib/session' + 'lib/session', + 'lib/password-mixin' ], -function (_, BaseView, Template, FxaClient, Session) { +function (_, BaseView, Template, FxaClient, Session, PasswordMixin) { var View = BaseView.extend({ // user must be authenticated to see Settings mustAuth: true, @@ -29,7 +30,8 @@ function (_, BaseView, Template, FxaClient, Session) { 'submit form': 'changePassword', 'keyup input': 'enableButtonWhenValid', 'change input': 'enableButtonWhenValid', - 'click #signout': 'signOut' + 'click #signout': 'signOut', + 'change .show-password': 'onPasswordVisibilityChange' }, isValid: function () { @@ -91,5 +93,7 @@ function (_, BaseView, Template, FxaClient, Session) { } }); + _.extend(View.prototype, PasswordMixin); + return View; });