forked from CGM_Public/pretix_original
Hide input dependencies recursively if input will be disabled (#4599)
--------- Co-authored-by: Mira <weller@rami.io>
This commit is contained in:
committed by
GitHub
parent
14c6c9c0d7
commit
901565203b
@@ -378,6 +378,7 @@ var form_handlers = function (el) {
|
||||
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.type === 'checkbox' || d.type === 'radio') {
|
||||
return d.checked;
|
||||
} else if (d.type === 'select-one') {
|
||||
@@ -398,7 +399,7 @@ var form_handlers = function (el) {
|
||||
}
|
||||
var $toggling = dependent;
|
||||
if (dependent.attr("data-disable-dependent")) {
|
||||
$toggling.attr('disabled', !enabled);
|
||||
$toggling.attr('disabled', !enabled).trigger("change");
|
||||
}
|
||||
if (dependent.get(0).tagName.toLowerCase() !== "div") {
|
||||
$toggling = dependent.closest('.form-group');
|
||||
|
||||
Reference in New Issue
Block a user