forked from e621ng/e621ng
parent
8f702da82a
commit
ac0ef59b3e
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PoolOrdersController < ApplicationController
|
||||
respond_to :html, :json, :js
|
||||
respond_to :html, :json
|
||||
before_action :member_only
|
||||
|
||||
def edit
|
||||
|
@ -1,3 +1,5 @@
|
||||
import Utility from "./utility";
|
||||
|
||||
let Pool = {};
|
||||
|
||||
Pool.dialog_setup = false;
|
||||
@ -35,12 +37,16 @@ Pool.initialize_simple_edit = function() {
|
||||
$("#sortable").disableSelection();
|
||||
|
||||
$("#ordering-form").submit(function(e) {
|
||||
$.ajax({
|
||||
type: "put",
|
||||
url: e.target.action,
|
||||
data: $("#sortable").sortable("serialize") + "&" + $(e.target).serialize()
|
||||
});
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: e.target.action,
|
||||
data: $("#sortable").sortable("serialize") + "&" + $(e.target).serialize() + "&format=json"
|
||||
}).done(() => {
|
||||
window.location.href = e.target.action;
|
||||
}).fail((data) => {
|
||||
Utility.error(`Error: ${data.responseText}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<%= custom_form_for(@pool, :format => :js, :html => {:id => "ordering-form"}) do |f| %>
|
||||
<%= submit_tag "Save" %>
|
||||
<%= custom_form_for(@pool, html: { id: "ordering-form" }) do |f| %>
|
||||
<%= f.submit "Save" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user