Refactor invite users modal initialization [SCI-2651]

This commit is contained in:
Oleksii Kriuchykhin 2018-08-20 13:13:34 +02:00
parent 422baaf64a
commit 6795b08a91
4 changed files with 7 additions and 4 deletions

View file

@ -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');
});

View file

@ -1,5 +1,3 @@
//= require users/settings/teams/invite_users_modal
(function() {
'use strict';

View file

@ -93,7 +93,7 @@
<div class="panel-body">
<div class="col-xs-24 col-sm-12">
<a href="#" class="btn btn-primary pull-right row" data-trigger="invite-users"
data-modal-id="team-invite-users-modal" data-remote="true">
data-modal-id="team-invite-users-modal">
<span class="fas fa-plus"></span>
<%= t("users.settings.teams.edit.add_user") %>
</a>
@ -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' %>
<span data-hook="team-bottom"></span>

View file

@ -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 +=