From a77f04f5f6313e32228bcf07b6ce2a74fd6bdf93 Mon Sep 17 00:00:00 2001 From: bfederle Date: Tue, 7 Feb 2012 14:31:01 -0800 Subject: [PATCH] Only show enter token button if no invitations are present --- ui/scripts/projects.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js index 35175c5b2b1..e07acdf3d7e 100644 --- a/ui/scripts/projects.js +++ b/ui/scripts/projects.js @@ -904,6 +904,22 @@ label: 'Enter Token', isHeader: true, addRow: false, + preFilter: function(args) { + var invitationsPresent = false; + + $.ajax({ + url: createURL('listProjectInvitations'), + data: { state: 'Pending' }, + async: false, + success: function(json) { + if (json.listprojectinvitationsresponse.count) { + invitationsPresent = true; + } + } + }); + + return !invitationsPresent; + }, createForm: { desc: 'Please enter the token that you were given in your invite e-mail.', fields: {