mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Merge pull request #7545 from lasniscinote/gl_SCI_10686
(fix) No error message at create new task modal from canvas [SCI-10686]
This commit is contained in:
commit
69006c033b
|
@ -23,6 +23,23 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#experiment-canvas').on('shown.bs.modal', () => {
|
||||
// disable the submit button by default
|
||||
$('#new-modal-submit-btn').prop('disabled', true);
|
||||
|
||||
// listen for input event on the my_module_name input field
|
||||
$(`${newMyModuleModal} #my_module_name`).on('input', function () {
|
||||
if ($(this).val().trim() !== '') {
|
||||
// enable the submit button if the input field is populated
|
||||
$('#new-modal-submit-btn').prop('disabled', false);
|
||||
} else {
|
||||
// otherwise, disable it
|
||||
$('#new-modal-submit-btn').prop('disabled', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Modal's submit handler function
|
||||
$(experimentWrapper)
|
||||
.on('ajax:success', newMyModuleModal, function() {
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<button type="button" class="btn btn-secondary" data-dismiss="modal">
|
||||
<%= t('general.cancel') %>
|
||||
</button>
|
||||
<%= f.submit t('experiments.canvas.new_my_module_modal.create'), class: "btn btn-primary" %>
|
||||
<%= f.submit t('experiments.canvas.new_my_module_modal.create'), class: "btn btn-primary", id: "new-modal-submit-btn" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue