From 42d4e9723c2dea1821d92ec5b37bd773d7eb0a52 Mon Sep 17 00:00:00 2001 From: Steven Miers Date: Wed, 15 Jul 2015 15:20:47 -0500 Subject: [PATCH] VRFS-3336 : Fix final save button on edit account profile. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Only bind the screen to ‘account/profile/samples’ if it is the user version * Parent parameter was being overwritten; change to use the provided argument. --- .../javascripts/accounts_profile_samples.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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(); }