From 42f71f4da81cdc076854480916547f45f687c47b Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Tue, 20 Dec 2016 09:49:21 +0100 Subject: [PATCH] Fix buttons disappear when deleting columns in samples datatable [SCI-807] --- app/assets/javascripts/samples/sample_datatable.js.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/samples/sample_datatable.js.erb b/app/assets/javascripts/samples/sample_datatable.js.erb index ba911e63e..d84e41d91 100644 --- a/app/assets/javascripts/samples/sample_datatable.js.erb +++ b/app/assets/javascripts/samples/sample_datatable.js.erb @@ -1200,6 +1200,11 @@ function changeToEditMode() { form .on('ajax:success', function() { + // 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(); @@ -1221,11 +1226,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(); loadColumnsNames();