diff --git a/app/assets/javascripts/protocols/index.js b/app/assets/javascripts/protocols/index.js index 89ef85b41..eed54dc7c 100644 --- a/app/assets/javascripts/protocols/index.js +++ b/app/assets/javascripts/protocols/index.js @@ -205,6 +205,7 @@ function initProtocolPreviewModal() { modalTitle.html(data.title); modalBody.html(data.html); modalFooter.html(data.footer); + initHandsOnTable(modalBody); modal.modal("show"); initHandsOnTable(modalBody); }, @@ -379,6 +380,7 @@ function initModals() { $("#protocol-preview-modal").on("hidden.bs.modal", function(e) { $(this).find(".modal-title").html(""); $(this).find(".modal-body").html(""); + $(this).find(".modal-footer").html(""); }); } diff --git a/app/assets/javascripts/protocols/steps.js.erb b/app/assets/javascripts/protocols/steps.js.erb index 1f2eeeda6..9dbb8b598 100644 --- a/app/assets/javascripts/protocols/steps.js.erb +++ b/app/assets/javascripts/protocols/steps.js.erb @@ -284,7 +284,6 @@ function toggleButtons(show) { // Creates handsontable where needed function initHandsOnTable(root) { - root.find("[data-role='hot-table']").each(function() { var $container = $(this).find("[data-role='step-hot-table']"); var contents = $(this).find('.hot-contents'); diff --git a/app/views/protocols/index/_protocol_preview_modal_body.html.erb b/app/views/protocols/index/_protocol_preview_modal_body.html.erb index 2a26af512..ea4530bf9 100644 --- a/app/views/protocols/index/_protocol_preview_modal_body.html.erb +++ b/app/views/protocols/index/_protocol_preview_modal_body.html.erb @@ -162,18 +162,3 @@ <% end %> - -<%= javascript_include_tag "protocols/steps" %> - - -<%= javascript_include_tag "lodash" %> -<%= javascript_include_tag "numeral" %> -<%= javascript_include_tag "numeric" %> -<%= javascript_include_tag "md5" %> -<%= javascript_include_tag "jstat" %> -<%= javascript_include_tag "formula" %> -<%= javascript_include_tag "parser" %> -<%= javascript_include_tag "ruleJS" %> -<%= javascript_include_tag "handsontable.formula" %> -<%= javascript_include_tag "big.min" %> -<%= stylesheet_link_tag "handsontable.formula" %> \ No newline at end of file