Files
grecia/app/assets/javascripts/sortable.js
Javi Martín 5fa6db2226 Rename HTML attributes referencing poll options
Since now poll question answers have been renamed to poll question
options, using HTML IDs, classes and data attributes named `answer` was
confusing.
2024-06-13 19:13:05 +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-option-id"
});
$.ajax({
url: $(this).data("js-url"),
data: {
ordered_list: new_order
},
type: "POST"
});
}
});
}
};
}).call(this);