staying on same page after saving a sample; fix button disappearance when adding new column

This commit is contained in:
Mojca Lorber 2016-12-20 15:19:31 +01:00
parent 165ec6144c
commit ba0214d1ff

View file

@ -651,7 +651,7 @@ function clearAllErrors() {
// Restore previous table // Restore previous table
function onClickCancel() { function onClickCancel() {
table.ajax.reload(); table.draw('page');
changeToViewMode(); changeToViewMode();
updateButtons(); updateButtons();
@ -881,6 +881,11 @@ function changeToEditMode() {
I18n.t('samples.js.column_added') + I18n.t('samples.js.column_added') +
'</span>'); '</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 // Destroy datatable
table.destroy(); table.destroy();
@ -902,11 +907,6 @@ function changeToEditMode() {
$('#samples thead').empty(); $('#samples thead').empty();
$('#samples thead').append(originalHeader); $('#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 // Re-initialize datatable
table = dataTableInit(); table = dataTableInit();
table.on('init.dt', function() { table.on('init.dt', function() {