We were using one label for both date selectors, but it wasn't associated with any of them. So we're now rendering one label per control and, just like we only show one of these date selectors at a time, we're only showing one label at a time.
21 lines
576 B
JavaScript
21 lines
576 B
JavaScript
(function() {
|
|
"use strict";
|
|
App.AdminPollShiftsForm = {
|
|
initialize: function() {
|
|
$("select[class='js-poll-shifts']").on({
|
|
change: function() {
|
|
switch ($(this).val()) {
|
|
case "vote_collection":
|
|
$(".js-shift-vote-collection-dates").show();
|
|
$(".js-shift-recount-scrutiny-dates").hide();
|
|
break;
|
|
case "recount_scrutiny":
|
|
$(".js-shift-recount-scrutiny-dates").show();
|
|
$(".js-shift-vote-collection-dates").hide();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
}).call(this);
|