mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-23 23:35:00 +08:00
Fix duplicated items created in inventories [SCI-8546]
Co-authored-by: Sboursen <dev.sboursen@gmail.com>
This commit is contained in:
parent
1a689c9329
commit
65cad3fedd
2 changed files with 8 additions and 2 deletions
|
@ -124,7 +124,7 @@ var RepositoryDatatable = (function(global) {
|
|||
}
|
||||
|
||||
function initEditRowForms() {
|
||||
let $forms = $(TABLE_ID).find('.repository-row-edit-form');
|
||||
let $forms = $(TABLE_ID).find('.repository-row-edit-form:not(#repositoryNewRowForm)');
|
||||
|
||||
let formsCount = $forms.length;
|
||||
$forms.each(function() {
|
||||
|
|
|
@ -118,7 +118,6 @@ var RepositoryDatatableRowEditor = (function() {
|
|||
|
||||
function addNewRow(table) {
|
||||
TABLE = table;
|
||||
|
||||
let $row = $(TABLE_ROW);
|
||||
const formId = 'repositoryNewRowForm';
|
||||
let actionUrl = $(TABLE.table().node()).data('createRecord');
|
||||
|
@ -164,6 +163,13 @@ var RepositoryDatatableRowEditor = (function() {
|
|||
initSmartAnnotation($row);
|
||||
initAssetCellActions($row);
|
||||
|
||||
$(`#${formId}`).on('ajax:complete', function() {
|
||||
$('html, body').animate({ scrollLeft: 0 }, 300);
|
||||
TABLE.ajax.reload(() => {
|
||||
animateSpinner(null, false);
|
||||
}, false);
|
||||
});
|
||||
|
||||
TABLE.columns.adjust();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue