mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-09 06:35:37 +08:00
Fix duplicate assignment modals (#3636)
Co-authored-by: Anton <anton@scinote.net>
This commit is contained in:
parent
e3d08db6de
commit
b0c031e4e3
3 changed files with 9 additions and 11 deletions
|
@ -10,13 +10,6 @@
|
||||||
Turbolinks.visit(targetPath);
|
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);
|
$(document).one('turbolinks:load', initModalCloseListeners);
|
||||||
|
|
|
@ -9,9 +9,14 @@
|
||||||
|
|
||||||
animateSpinner();
|
animateSpinner();
|
||||||
$.get(ev.currentTarget.getAttribute('href')).then(function({ modal }) {
|
$.get(ev.currentTarget.getAttribute('href')).then(function({ modal }) {
|
||||||
$(modal).on('shown.bs.modal', function() {
|
$(modal)
|
||||||
$(this).find('.selectpicker').selectpicker();
|
.on('shown.bs.modal', function() {
|
||||||
}).modal('show');
|
$(this).find('.selectpicker').selectpicker();
|
||||||
|
})
|
||||||
|
.on('hidden.bs.modal', function() {
|
||||||
|
$(this).remove();
|
||||||
|
})
|
||||||
|
.modal('show');
|
||||||
animateSpinner(null, false);
|
animateSpinner(null, false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<%= t '.title', resource_name: resource.name %>
|
<%= t '.title', resource_name: resource.name %>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<%= 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| %>
|
<%= 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| %>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group">
|
<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' } %>
|
<%= 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…
Add table
Reference in a new issue