From 224bcf0c2bbbd75beb037816d9b14626ac5b841c Mon Sep 17 00:00:00 2001 From: denise Date: Fri, 11 Jan 2013 15:12:41 -0500 Subject: [PATCH] CC-4793: System -> User: Sometimes the user type's tips turns out "undefined" -fixed --- airtime_mvc/public/js/airtime/user/user.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/js/airtime/user/user.js b/airtime_mvc/public/js/airtime/user/user.js index 55155cda5..1aa53c332 100644 --- a/airtime_mvc/public/js/airtime/user/user.js +++ b/airtime_mvc/public/js/airtime/user/user.js @@ -99,9 +99,7 @@ function sizeFormElements() { $("dd[id$='element']").addClass('user-form-element'); } -$(document).ready(function() { - populateUserTable(); - +function assignUserRightsToUserTypes() { //assign user-rights and id to each user type option so we can //display user rights for each with tipsy tooltip $.each($('#type').children(), function(i, opt) { @@ -159,6 +157,10 @@ $(document).ready(function() { break; } }); +} +$(document).ready(function() { + populateUserTable(); + assignUserRightsToUserTypes(); $('#type').live("change", function(){ //when the title changes on live tipsy tooltips the changes take @@ -192,6 +194,7 @@ $(document).ready(function() { if (json.valid === "true") { $('#content').empty().append(json.html); populateUserTable(); + assignUserRightsToUserTypes(); } else { //if form is invalid we only need to redraw the form $('#user_form').empty().append($(json.html).find('#user_form').children());