mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-25 00:03:27 +08:00
Merge pull request #5503 from sboursen-scinote/sb_SCI-8546
Duplicated item created in the inventory [SCI-8546]
This commit is contained in:
commit
b1fe71719a
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