mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 14:44:26 +08:00
staying on same page after saving a sample; fix button disappearance when adding new column
This commit is contained in:
parent
165ec6144c
commit
ba0214d1ff
1 changed files with 6 additions and 6 deletions
|
@ -651,7 +651,7 @@ function clearAllErrors() {
|
|||
|
||||
// Restore previous table
|
||||
function onClickCancel() {
|
||||
table.ajax.reload();
|
||||
table.draw('page');
|
||||
|
||||
changeToViewMode();
|
||||
updateButtons();
|
||||
|
@ -881,6 +881,11 @@ function changeToEditMode() {
|
|||
I18n.t('samples.js.column_added') +
|
||||
'</span>');
|
||||
|
||||
// Preserve save/delete buttons as we need them after new table
|
||||
// will be created
|
||||
$('div.toolbarButtons').appendTo('div.samples-table');
|
||||
$('div.toolbarButtons').hide();
|
||||
|
||||
// Destroy datatable
|
||||
table.destroy();
|
||||
|
||||
|
@ -902,11 +907,6 @@ function changeToEditMode() {
|
|||
$('#samples thead').empty();
|
||||
$('#samples thead').append(originalHeader);
|
||||
|
||||
// Preserve save/delete buttons as we need them after new table
|
||||
// will be created
|
||||
$('div.toolbarButtons').appendTo('div.samples-table');
|
||||
$('div.toolbarButtons').hide();
|
||||
|
||||
// Re-initialize datatable
|
||||
table = dataTableInit();
|
||||
table.on('init.dt', function() {
|
||||
|
|
Loading…
Reference in a new issue