mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-10 14:46:42 +08:00
minor changes, working on refresh after submit
This commit is contained in:
parent
72c707ae88
commit
d59234a1e3
3 changed files with 8 additions and 3 deletions
|
@ -335,9 +335,11 @@ function initModals() {
|
||||||
modal.find(".modal-body").html("");
|
modal.find(".modal-body").html("");
|
||||||
|
|
||||||
// Simply re-render table
|
// Simply re-render table
|
||||||
protocolsDatatable.ajax.reload();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Make private modal hidden action
|
// Make private modal hidden action
|
||||||
$("#make-private-results-modal").on("hidden.bs.modal", function(e) {
|
$("#make-private-results-modal").on("hidden.bs.modal", function(e) {
|
||||||
refresh($(this));
|
refresh($(this));
|
||||||
|
|
|
@ -835,12 +835,15 @@ def protocolsio_import_save
|
||||||
format.json {
|
format.json {
|
||||||
render json: { name: p_name, status: :bad_request }, status: :bad_request
|
render json: { name: p_name, status: :bad_request }, status: :bad_request
|
||||||
}
|
}
|
||||||
|
|
||||||
#:location => root_url
|
#:location => root_url
|
||||||
|
# protocolsDatatable.ajax.reload();
|
||||||
|
# $('#modal-import-json-protocol-preview').modal('hide');
|
||||||
else
|
else
|
||||||
format.json {
|
format.json {
|
||||||
render json: {
|
render json: {
|
||||||
name: p_name, new_name: protocol.name, status: :ok
|
name: p_name, new_name: protocol.name, status: :ok
|
||||||
},redirect_to: @protocol,
|
},
|
||||||
status: :ok
|
status: :ok
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -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| %>
|
<%#= fields_for :steps do |g| %>
|
||||||
<% #json_string= JSON.parse(json_string)%>
|
<% #json_string= JSON.parse(json_string)%>
|
||||||
<% #json_string = JSON.generate(json_string['steps'])
|
<% #json_string = JSON.generate(json_string['steps'])
|
||||||
|
|
Loading…
Reference in a new issue