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 98c0ed51a..51cd11c53 100644 --- a/app/assets/javascripts/users/settings/teams/invite_users_modal.js +++ b/app/assets/javascripts/users/settings/teams/invite_users_modal.js @@ -164,8 +164,10 @@ } function initializeModalsToggle() { - $("[data-trigger='invite-users']").on('click', function() { + $("[data-trigger='invite-users']").on('click', function(event) { var id = $(this).attr('data-modal-id'); + event.preventDefault(); + event.stopPropagation(); $('[data-role=invite-users-modal][data-id=' + id + ']') .modal('show'); }); diff --git a/app/assets/javascripts/users/settings/teams/show.js b/app/assets/javascripts/users/settings/teams/show.js index 26b9f8d8e..5972d1bce 100644 --- a/app/assets/javascripts/users/settings/teams/show.js +++ b/app/assets/javascripts/users/settings/teams/show.js @@ -1,5 +1,3 @@ -//= require users/settings/teams/invite_users_modal - (function() { 'use strict'; diff --git a/app/views/users/settings/teams/show.html.erb b/app/views/users/settings/teams/show.html.erb index 3d89a65eb..f36e122f1 100644 --- a/app/views/users/settings/teams/show.html.erb +++ b/app/views/users/settings/teams/show.html.erb @@ -93,7 +93,7 @@
+ data-modal-id="team-invite-users-modal"> <%= t("users.settings.teams.edit.add_user") %> @@ -137,4 +137,5 @@ <%= render partial: 'users/settings/user_teams/destroy_user_team_modal.html.erb' %> <%= stylesheet_link_tag 'datatables' %> <%= javascript_include_tag 'users/settings/teams/show' %> +<%= javascript_include_tag 'users/settings/teams/invite_users_modal' %> diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index d8c70c289..f5fc0767e 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -28,6 +28,8 @@ Rails.application.config.assets.precompile += Rails.application.config.assets.precompile += %w(users/settings/teams/add_user_modal.js) Rails.application.config.assets.precompile += %w(users/settings/teams/show.js) +Rails.application.config.assets.precompile += + %w(users/settings/teams/invite_users_modal.js) Rails.application.config.assets.precompile += %w(my_modules/activities.js) Rails.application.config.assets.precompile += %w(my_modules/protocols.js) Rails.application.config.assets.precompile +=