From d37f3a3c0921a5c4eba0820c8e518557b76fddaf Mon Sep 17 00:00:00 2001 From: mlorb Date: Fri, 7 Dec 2018 11:36:26 +0100 Subject: [PATCH] fix invited member is added multiple times to team --- .../javascripts/users/settings/teams/invite_users_modal.js | 4 ++-- app/views/users/settings/teams/show.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/users/settings/teams/invite_users_modal.js b/app/assets/javascripts/users/settings/teams/invite_users_modal.js index 638d2c330..55ebbca28 100644 --- a/app/assets/javascripts/users/settings/teams/invite_users_modal.js +++ b/app/assets/javascripts/users/settings/teams/invite_users_modal.js @@ -20,7 +20,7 @@ maxTags: modal.data('max-tags') }); - modal.on('show.bs.modal', function() { + modal.off('show.bs.modal').on('show.bs.modal', function() { // This cannot be scoped outside this function // because it is generated via JS teamSelectorDropdown2 = teamSelectorDropdown.parent() @@ -83,7 +83,7 @@ }); // Click action - modal.find('[data-action=invite]').on('click', function() { + modal.find('[data-action=invite]').off('click').on('click', function() { var data = { emails: tagsInput.val() }; diff --git a/app/views/users/settings/teams/show.html.erb b/app/views/users/settings/teams/show.html.erb index f36e122f1..0271b5866 100644 --- a/app/views/users/settings/teams/show.html.erb +++ b/app/views/users/settings/teams/show.html.erb @@ -93,7 +93,7 @@