app/views/decidim/proposals/admin/participatory_texts/index.html.erb in decidim-proposals-0.21.0 vs app/views/decidim/proposals/admin/participatory_texts/index.html.erb in decidim-proposals-0.22.0

- old
+ new

@@ -14,11 +14,11 @@ data-multi-expand="true" data-allow-all-closed="true"> <%= form.fields_for(:proposals) do |prop_form| %> <% proposal= @drafts[prop_form.index] %> <li class="accordion-item <%= proposal.article? ? "is-active" : nil %>" data-accordion-item> - <a href="#" class="accordion-title flex--sbc"><%= preview_participatory_text_section_title(proposal) %><span class="mr-m"><%= icon "menu", class: "icon--small" %></span></a> + <a href="#" class="accordion-title flex--sbc"><%= preview_participatory_text_section_title(proposal) %><span class="mr-m"><%= icon "menu", class: "icon--small", role: "img", "aria-hidden": true %></span></a> <div class="accordion-content" data-tab-content> <%= render "article-preview", { form: prop_form, proposal: proposal } %> </div> </li> <% end %> @@ -33,9 +33,17 @@ </div> <% end %> <% end -%> <script> $(window).on("load", function() { + // Not all browsers submit the buttons as form data. + $('button[name="save_draft"]').on("click", function(ev) { + ev.preventDefault(); + + var $form = $(this).parents("form"); + $form.append('<input type="hidden" name="save_draft" value="true" />'); + $form.submit(); + }); $( "#participatory-text" ).on( "sortupdate", function( event, ui ) { $('#participatory-text li').each(function(idx, li) { input= $(li).find("input.position").val(idx+1) })