From 6a4c38bbee58f49ed80fcc1586833f13a1e42245 Mon Sep 17 00:00:00 2001 From: Zanz2 Date: Fri, 3 Nov 2017 01:04:50 +0100 Subject: [PATCH] Fixed table elements render bugs, now renders after shown event --- .../_import_json_protocol_p_desc.html.erb | 40 ++++++++++------- .../_import_json_protocol_s_desc.html.erb | 43 +++++++++++-------- 2 files changed, 50 insertions(+), 33 deletions(-) diff --git a/app/views/protocols/import_export/_import_json_protocol_p_desc.html.erb b/app/views/protocols/import_export/_import_json_protocol_p_desc.html.erb index 2ad86270e..59b4d63e5 100644 --- a/app/views/protocols/import_export/_import_json_protocol_p_desc.html.erb +++ b/app/views/protocols/import_export/_import_json_protocol_p_desc.html.erb @@ -17,6 +17,7 @@

<% prot_info_string = '' %> + <% protocol_table_elements_array = [] %> <% if json_object['before_start'].present? %> <% prot_info_string += (json_object['before_start']) %> <%= t('protocols.protocols_io_import.preview.b_s_p') %> @@ -67,21 +68,32 @@ <% if tables.present? %>


<% end %> - <%#= sanitize_input(garbage.html_safe) %> <% table_count = 0 %> <% tables.each do |index, table| %> <% table_hash = JSON.parse((Base64.decode64(table['contents']))) %> <% pio_table_id = "pio_table_prot_info_"+table_count.to_s %> -
+ <% protocol_table_elements_array.push([pio_table_id,table_hash['data']]) %> +
-
- - <% table_count += 1 %> - <% end %> -
- - - + }); +} +}) + + diff --git a/app/views/protocols/import_export/_import_json_protocol_s_desc.html.erb b/app/views/protocols/import_export/_import_json_protocol_s_desc.html.erb index 9b79e4ba3..2654e9a19 100644 --- a/app/views/protocols/import_export/_import_json_protocol_s_desc.html.erb +++ b/app/views/protocols/import_export/_import_json_protocol_s_desc.html.erb @@ -114,31 +114,40 @@ <% tables.each do |index, table| %> <% table_hash = JSON.parse((Base64.decode64(table['contents']))) %> <% pio_table_id = "pio_table_step_"+counter.to_s+"_info_"+table_count.to_s %> - <% step_table_elements_array.push([pio_table_id,table_hash]) %> -
+ <% step_table_elements_array.push([pio_table_id,table_hash['data']]) %> +
-
- + <% table_count += 1 %> <% end %> + <% end #step loop%>
+