forked from CGM_Public/pretix_original
Add frontend support for long multiple choice widgets
This commit is contained in:
@@ -323,4 +323,22 @@ $(function () {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
return true;
|
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;
|
color: $text-muted;
|
||||||
font-weight: normal;
|
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