mirror of
https://github.com/pretix/pretix.git
synced 2026-08-24 13:02:00 +00:00
Merge remote-tracking branch 'refs/remotes/origin/master' into questions-vue3
This commit is contained in:
@@ -33,6 +33,13 @@ $(function () {
|
||||
dependents[cleanName($(this).attr("name"))] = $(this)
|
||||
})
|
||||
|
||||
const dependentsDisabled = [];
|
||||
for (var k in dependents) {
|
||||
if (dependents[k].prop("disabled")) {
|
||||
dependentsDisabled.push(k);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Object.values(dependents).some((el) => el.length)) {
|
||||
// No address fields found, do not create request
|
||||
return;
|
||||
@@ -101,7 +108,7 @@ $(function () {
|
||||
label.append('<i class="label-required">' + gettext('required') + '</i>')
|
||||
}
|
||||
}
|
||||
for (var k in dependents) dependents[k].prop("disabled", false);
|
||||
for (var k in dependents) dependents[k].prop("disabled", dependentsDisabled.includes(k));
|
||||
loader.hide();
|
||||
}
|
||||
|
||||
@@ -158,7 +165,7 @@ $(function () {
|
||||
required = false;
|
||||
|
||||
dependent.closest(".form-group").toggle(visible).toggleClass('required', required);
|
||||
dependent.prop("required", required).prop("disabled", false);
|
||||
dependent.prop("required", required).prop("disabled", dependentsDisabled.includes(k));
|
||||
}
|
||||
}).finally(function () {
|
||||
loader.hide();
|
||||
@@ -174,7 +181,7 @@ $(function () {
|
||||
const fill_peppol_id = function () {
|
||||
const vatId = dependents.vat_id.val();
|
||||
if (vatId && vatId.startsWith("BE") && dependents.transmission_type.val() === "peppol") {
|
||||
dependents.transmission_peppol_participant_id.val("0208:" + vatId.substring(2))
|
||||
dependents.transmission_peppol_participant_id.val("0208:" + vatId.substring(2).replaceAll(".", ""))
|
||||
}
|
||||
}
|
||||
dependents.vat_id.add(dependents.transmission_type).on("change", fill_peppol_id);
|
||||
|
||||
@@ -340,11 +340,12 @@ var form_handlers = function (el) {
|
||||
}
|
||||
|
||||
el.find("input[data-checkbox-dependency]").each(function () {
|
||||
var initially_disabled = $(this).prop("disabled");
|
||||
var dependent = $(this),
|
||||
dependency = findDependency($(this).attr("data-checkbox-dependency"), this),
|
||||
update = function () {
|
||||
var enabled = dependency.prop('checked');
|
||||
dependent.prop('disabled', !enabled).closest('.form-group, .form-field-boundary').toggleClass('disabled', !enabled);
|
||||
dependent.prop('disabled', !enabled || initially_disabled).closest('.form-group, .form-field-boundary').toggleClass('disabled', !enabled);
|
||||
if (!enabled && !dependent.is('[data-checkbox-dependency-visual]')) {
|
||||
dependent.prop('checked', false);
|
||||
dependent.trigger('change')
|
||||
@@ -366,11 +367,12 @@ var form_handlers = function (el) {
|
||||
});
|
||||
|
||||
el.find("div[data-display-dependency], textarea[data-display-dependency], input[data-display-dependency], select[data-display-dependency], button[data-display-dependency]").each(function () {
|
||||
var initially_disabled = $(this).prop("disabled");
|
||||
var dependent = $(this),
|
||||
dependency = findDependency($(this).attr("data-display-dependency"), this),
|
||||
update = function (ev) {
|
||||
var enabled = dependency.toArray().some(function(d) {
|
||||
if (d.disabled) return false;
|
||||
if (d.disabled && !initially_disabled) return false;
|
||||
if (d.type === 'checkbox' || d.type === 'radio') {
|
||||
return d.checked;
|
||||
} else if (d.type === 'select-one') {
|
||||
@@ -391,7 +393,7 @@ var form_handlers = function (el) {
|
||||
}
|
||||
var $toggling = dependent;
|
||||
if (dependent.is("[data-disable-dependent]")) {
|
||||
$toggling.attr('disabled', !enabled).trigger("change");
|
||||
$toggling.attr('disabled', !enabled || initially_disabled).trigger("change");
|
||||
}
|
||||
const tagName = dependent.get(0).tagName.toLowerCase()
|
||||
if (tagName !== "div" && tagName !== "button") {
|
||||
|
||||
@@ -417,6 +417,30 @@ div.scrolling-multiple-choice, div.scrolling-choice {
|
||||
}
|
||||
}
|
||||
}
|
||||
.team-permission-groups {
|
||||
border: 1px solid $input-border;
|
||||
border-radius: $input-border-radius;
|
||||
padding: 10px 15px;
|
||||
|
||||
.radio {
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
&:not(:has(.fa-fw)) {
|
||||
// Visual adjustment between options with and without help text
|
||||
&:after {
|
||||
display: inline-block;
|
||||
content: " ";
|
||||
padding-right: 1.28571em;
|
||||
}
|
||||
}
|
||||
}
|
||||
.control-label {
|
||||
text-align: left;
|
||||
}
|
||||
.form-group:last-child, .help-block {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
table td > .checkbox {
|
||||
margin: 0;
|
||||
position: static;
|
||||
|
||||
@@ -1762,21 +1762,10 @@ Vue.component('pretix-widget', {
|
||||
methods: shared_methods,
|
||||
mounted: function () {
|
||||
var thisObj = this;
|
||||
if ("ResizeObserver" in window) {
|
||||
var resizeObserver = new ResizeObserver(function(entries) {
|
||||
thisObj.mobile = entries[0].contentRect.width <= 800;
|
||||
});
|
||||
resizeObserver.observe(this.$refs.wrapper);
|
||||
} else {
|
||||
this.mobile = this.$refs.wrapper.clientWidth <= 800;
|
||||
var debounce;
|
||||
window.addEventListener("resize", function() {
|
||||
if (debounce) clearTimeout(debounce);
|
||||
debounce = setTimeout(function () {
|
||||
thisObj.mobile = thisObj.$refs.wrapper.clientWidth <= 800;
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
var resizeObserver = new ResizeObserver(function(entries) {
|
||||
thisObj.mobile = entries[0].contentRect.width <= 800;
|
||||
});
|
||||
resizeObserver.observe(this.$refs.wrapper);
|
||||
},
|
||||
computed: {
|
||||
classObject: function () {
|
||||
|
||||
Reference in New Issue
Block a user