diff --git a/app/assets/javascripts/protocols/index.js b/app/assets/javascripts/protocols/index.js index 13960bbec..031731988 100644 --- a/app/assets/javascripts/protocols/index.js +++ b/app/assets/javascripts/protocols/index.js @@ -335,9 +335,11 @@ function initModals() { modal.find(".modal-body").html(""); // Simply re-render table - protocolsDatatable.ajax.reload(); + } + + // Make private modal hidden action $("#make-private-results-modal").on("hidden.bs.modal", function(e) { refresh($(this)); diff --git a/app/controllers/protocols_controller.rb b/app/controllers/protocols_controller.rb index 065b324b5..826e74d82 100644 --- a/app/controllers/protocols_controller.rb +++ b/app/controllers/protocols_controller.rb @@ -835,12 +835,15 @@ def protocolsio_import_save format.json { render json: { name: p_name, status: :bad_request }, status: :bad_request } + #:location => root_url + # protocolsDatatable.ajax.reload(); + # $('#modal-import-json-protocol-preview').modal('hide'); else format.json { render json: { name: p_name, new_name: protocol.name, status: :ok - },redirect_to: @protocol, + }, status: :ok } end diff --git a/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb b/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb index 13062d761..5e21c811e 100644 --- a/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb +++ b/app/views/protocols/import_export/_import_json_protocol_preview_modal.html.erb @@ -1,4 +1,4 @@ -<%= form_for(@protocol, :url => url_for(:controller => 'protocols', :action => 'protocolsio_import_save'),method: :post,format: :json,remote: true) do |f| %> +<%= form_for(@protocol, :url => url_for(:controller => 'protocols', :action => 'protocolsio_import_save'),method: :post,format: :json,remote: true,:html => { :id => "protocolsio-import-form" }) do |f| %> <%#= fields_for :steps do |g| %> <% #json_string= JSON.parse(json_string)%> <% #json_string = JSON.generate(json_string['steps'])