diff --git a/web/app/assets/javascripts/accounts_profile_samples.js b/web/app/assets/javascripts/accounts_profile_samples.js index 112a0e78f..5fe8ba153 100644 --- a/web/app/assets/javascripts/accounts_profile_samples.js +++ b/web/app/assets/javascripts/accounts_profile_samples.js @@ -20,8 +20,6 @@ var ui = new context.JK.UIHelper(JK.app); var target = {}; var profileUtils = context.JK.ProfileUtils; - parent - var parent = $(".account-profile-samples") var $screen = $('.profile-online-sample-controls', parent); // online presences @@ -227,8 +225,8 @@ }) } - function enableSubmits() { - $btnSubmit.off("click").on("click", function(e) { + function enableSubmits() { + $btnSubmit.off("click").on("click", function(e) { e.stopPropagation(); handleUpdateProfile(); return false; @@ -463,7 +461,7 @@ }); //}); - + } // end initializeValidators. @@ -477,7 +475,12 @@ 'afterShow': afterShow }; - app.bindScreen('account/profile/samples', screenBindings); + // We only want to bind this screen for accounts: + if (updateFn.name===api.updateUser.name) { + // A little hacky, but we are soon going to replace this: + app.bindScreen('account/profile/samples', screenBindings); + } + initializeValidators(); events(); }