Files
grecia/app/assets/javascripts/sortable.js
decabeza d2cc110678 Use this instead of the CSS selector .sortable
In this context, `this` already points to the element, so there is no
need to search it again.
2022-10-18 10:38:59 +02:00

23 lines
488 B
JavaScript

(function() {
"use strict";
App.Sortable = {
initialize: function() {
$(".sortable").sortable({
update: function() {
var new_order;
new_order = $(this).sortable("toArray", {
attribute: "data-answer-id"
});
$.ajax({
url: $(this).data("js-url"),
data: {
ordered_list: new_order
},
type: "POST"
});
}
});
}
};
}).call(this);