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
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() {