mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #4828 from sboursen-scinote/sb_SCI-7745
Fix: Edit task from experiment table view - Enter causes error [SCI-7745]
This commit is contained in:
commit
07f2b83f81
1 changed files with 17 additions and 3 deletions
|
@ -197,11 +197,12 @@ var ExperimnetTable = {
|
|||
$('#modal-edit-module').data('id', this.selectedMyModules[0]);
|
||||
$('#edit-module-name-input').val($(`#taskName${$('#modal-edit-module').data('id')}`).data('full-name'));
|
||||
});
|
||||
$('#modal-edit-module').on('click', 'button[data-action="confirm"]', () => {
|
||||
|
||||
const handleRenameModal = () => {
|
||||
let id = $('#modal-edit-module').data('id');
|
||||
let newValue = $('#edit-module-name-input').val();
|
||||
|
||||
$(`.my-module-selector[data-my-module="${id}"]`).click();
|
||||
$(`.my-module-selector[data-my-module="${id}"]`).trigger('click');
|
||||
|
||||
if (newValue === $(`#taskName${id}`).data('full-name')) {
|
||||
$('#modal-edit-module').modal('hide');
|
||||
|
@ -227,8 +228,21 @@ var ExperimnetTable = {
|
|||
}
|
||||
});
|
||||
|
||||
if ($(`.my-module-selector[data-my-module="${id}"]`).prop('checked')) {
|
||||
$(`.my-module-selector[data-my-module="${id}"]`).trigger('click');
|
||||
}
|
||||
|
||||
this.clearRowTaskSelection();
|
||||
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
$('#modal-edit-module')
|
||||
.on('click', 'button[data-action="confirm"]', handleRenameModal)
|
||||
.on('submit', 'form', (e) => {
|
||||
e.preventDefault();
|
||||
handleRenameModal();
|
||||
});
|
||||
},
|
||||
initManageUsersDropdown: function() {
|
||||
$(this.table).on('show.bs.dropdown', '.assign-users-dropdown', (e) => {
|
||||
|
|
Loading…
Reference in a new issue