mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-29 08:24:40 +08:00
Submit task create action with js in canvas view [SCI-10500]
This commit is contained in:
parent
307db56712
commit
fc7bf6c991
2 changed files with 16 additions and 1 deletions
|
@ -7,7 +7,22 @@
|
|||
let myModuleUserSelector = '#my_module_user_ids';
|
||||
var myModuleTagsSelector = '#module-tags-selector';
|
||||
|
||||
$(document).on('submit', '#new-my-module-modal form', (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
$.post({
|
||||
url: $('#new-my-module-modal form').attr('action'),
|
||||
data: {
|
||||
my_module: {
|
||||
name: $('#new-my-module-modal input[name="my_module[name]"]').val(),
|
||||
view_mode: $('#new-my-module-modal input[name="my_module[view_mode]"]').val(),
|
||||
due_date: $('#new-my-module-modal input[name="my_module[due-date]"]').val(),
|
||||
tag_ids: dropdownSelector.getValues(myModuleTagsSelector),
|
||||
user_ids: dropdownSelector.getValues(myModuleUserSelector)
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// Modal's submit handler function
|
||||
$(experimentWrapper)
|
||||
.on('ajax:success', newMyModuleModal, function() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="modal" id="new-my-module-modal" tabindex="-1" role="dialog"
|
||||
data-create-url="<%= modules_experiment_path(@experiment) %>" data-user-id="<%= current_user.id %>">
|
||||
<%= form_with model: @my_module, url: modules_experiment_path(@experiment), data: { remote: true } do |f| %>
|
||||
<%= form_with model: @my_module, url: modules_experiment_path(@experiment) do |f| %>
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
|
Loading…
Add table
Reference in a new issue