mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Close access grant modal after submit [SCI-6205] (#3631)
Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
parent
1ef9ea2cbb
commit
5081e90fd6
2 changed files with 8 additions and 1 deletions
|
@ -10,6 +10,13 @@
|
|||
Turbolinks.visit(targetPath);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('ajax:success', 'form[data-action*="modal-close"]', function(_, { form, flash }) {
|
||||
$(this).closest('.modal').modal('hide');
|
||||
if (flash) {
|
||||
HelperModule.flashAlertMsg(flash, 'success');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).one('turbolinks:load', initModalCloseListeners);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<%= t '.title', resource_name: resource.name %>
|
||||
</h4>
|
||||
</div>
|
||||
<%= form_with(model: form_object, url: create_path, method: :post, remote: true, html: { id: 'new-user-assignment-to-project-form', data: { action: 'replace-form', target: '#user_assignments_modal' } }) do |f| %>
|
||||
<%= form_with(model: form_object, url: create_path, method: :post, remote: true, html: { id: 'new-user-assignment-to-project-form', data: { action: 'modal-close' } }) do |f| %>
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag :search_users, '', placeholder: t('.find_people_html'), class: 'form-control', data: { action: 'filter-list', target: 'new-user-assignment-to-project-form' } %>
|
||||
|
|
Loading…
Reference in a new issue