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:
@@ -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);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user