Add VotationType fields to admin poll question form

This commit is contained in:
decabeza
2022-08-30 13:13:33 +02:00
committed by Senén Rodero Rodríguez
parent d1c1aa6691
commit 815a526d78
13 changed files with 129 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
(function() {
"use strict";
App.AdminVotationTypesFields = {
adjustForm: function() {
if ($(this).val() === "unique") {
$(".max-votes").hide();
$(".description-unique").show();
$(".description-multiple").hide();
$(".votation-type-max-votes").prop("disabled", true);
} else {
$(".max-votes").show();
$(".description-unique").hide();
$(".description-multiple").show();
$(".votation-type-max-votes").prop("disabled", false);
}
},
initialize: function() {
$(".votation-type-vote-type").on("change", App.AdminVotationTypesFields.adjustForm).trigger("change");
}
};
}).call(this);