Move poll shifts form partial to a component

Thanks to it, we can move a few helper methods to the component.
This commit is contained in:
Javi Martín
2024-10-12 18:23:54 +02:00
parent 9ab6c15975
commit ee34ead4ee
7 changed files with 67 additions and 54 deletions

View File

@@ -0,0 +1,20 @@
(function() {
"use strict";
App.AdminPollShiftsForm = {
initialize: function() {
$("select[class='js-poll-shifts']").on({
change: function() {
switch ($(this).val()) {
case "vote_collection":
$("select[class='js-shift-vote-collection-dates']").show();
$("select[class='js-shift-recount-scrutiny-dates']").hide();
break;
case "recount_scrutiny":
$("select[class='js-shift-recount-scrutiny-dates']").show();
$("select[class='js-shift-vote-collection-dates']").hide();
}
}
});
}
};
}).call(this);