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.
This commit is contained in:
Javi Martín
2024-06-13 14:48:03 +02:00
parent 8997ed316c
commit 5fa6db2226
31 changed files with 58 additions and 58 deletions

View File

@@ -19,7 +19,7 @@
return max_order;
},
nestedOptions: function() {
$(".js-answers").each(function(index, options) {
$(".js-options").each(function(index, options) {
App.Options.initializeOptions(options);
});
},

View File

@@ -4,19 +4,19 @@
initialize: function() {
$(".zoom-link").on("click", function(event) {
var option;
option = $(event.target).closest("div.answer");
option = $(event.target).closest("div.option");
if ($(option).hasClass("medium-6")) {
$(option).removeClass("medium-6");
$(option).addClass("answer-divider");
$(option).addClass("option-divider");
if (!$(option).hasClass("first")) {
$(option).insertBefore($(option).prev("div.answer"));
$(option).insertBefore($(option).prev("div.option"));
}
} else {
$(option).addClass("medium-6");
$(option).removeClass("answer-divider");
$(option).removeClass("option-divider");
if (!$(option).hasClass("first")) {
$(option).insertAfter($(option).next("div.answer"));
$(option).insertAfter($(option).next("div.option"));
}
}
});

View File

@@ -3,7 +3,7 @@
App.Questions = {
nestedQuestions: function() {
$(".js-questions").on("cocoon:after-insert", function(e, new_question) {
App.Options.initializeOptions($(new_question).find(".js-answers"));
App.Options.initializeOptions($(new_question).find(".js-options"));
});
},
initialize: function() {

View File

@@ -6,7 +6,7 @@
update: function() {
var new_order;
new_order = $(this).sortable("toArray", {
attribute: "data-answer-id"
attribute: "data-option-id"
});
$.ajax({
url: $(this).data("js-url"),