mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Add frontend support for long multiple choice widgets
This commit is contained in:
@@ -323,4 +323,22 @@ $(function () {
|
||||
ev.preventDefault();
|
||||
return true;
|
||||
})
|
||||
|
||||
$(".scrolling-multiple-choice").each(function () {
|
||||
var $small = $("<small>");
|
||||
var $a_all = $("<a>").addClass("choice-options-all").attr("href", "#").text(gettext("Alle"));
|
||||
var $a_none = $("<a>").addClass("choice-options-none").attr("href", "#").text(gettext("Keine"));
|
||||
$(this).prepend($small.append($a_all).append(" / ").append($a_none));
|
||||
|
||||
$(this).find(".choice-options-none").click(function (e) {
|
||||
$(this).closest(".scrolling-multiple-choice").find("input[type=checkbox]").prop("checked", false);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
$(this).find(".choice-options-all").click(function (e) {
|
||||
$(this).closest(".scrolling-multiple-choice").find("input[type=checkbox]").prop("checked", true);
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
@@ -245,3 +245,16 @@ label .optional {
|
||||
color: $text-muted;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.scrolling-multiple-choice {
|
||||
height: 150px;
|
||||
border: 1px solid $input-border;
|
||||
border-radius: $input-border-radius;
|
||||
padding-left: 15px;
|
||||
overflow-y: auto;
|
||||
padding-top: 5px;
|
||||
|
||||
.radio:first-of-type, .checkbox:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user