mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
Small JS improvements
This commit is contained in:
@@ -1,30 +1,29 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
hideDeselected();
|
hideDeselected(false);
|
||||||
});
|
|
||||||
|
|
||||||
function hideDeselected() {
|
function hideDeselected(animate) {
|
||||||
var v = $("input[name='quota_option']:checked").val();
|
var v = $("input[name='quota_option']:checked").val(),
|
||||||
|
fn = animate ? 'slideDown' : 'show';
|
||||||
if (v === "existing") {
|
if (v === "existing") {
|
||||||
hideAll();
|
hideAll(animate);
|
||||||
$("#existing-quota-group").children().slideDown();
|
$("#existing-quota-group").children()[fn]();
|
||||||
} else if (v === "new") {
|
} else if (v === "new") {
|
||||||
hideAll();
|
hideAll(animate);
|
||||||
$("#new-quota-group").children().slideDown();
|
$("#new-quota-group").children()[fn]();
|
||||||
} else {
|
} else {
|
||||||
hideAll();
|
hideAll(animate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
function hideAll() {
|
function hideAll(animate) {
|
||||||
$("#new-quota-group").children().slideUp();
|
var fn = animate ? 'slideUp' : 'hide';
|
||||||
$("#existing-quota-group").children().slideUp();
|
$("#new-quota-group").children()[fn]();
|
||||||
};
|
$("#existing-quota-group").children()[fn]();
|
||||||
|
}
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$("input[name='quota_option']").on('change',
|
$("input[name='quota_option']").on('change',
|
||||||
function() {
|
function () {
|
||||||
hideDeselected();
|
hideDeselected(true);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user