Revert and fix an undefined value returned instead of a false value

This commit is contained in:
GogoVega 2024-05-28 22:08:42 +02:00
parent 67cdf3ef96
commit 6c14ed0ef5
No known key found for this signature in database
GPG Key ID: E1E048B63AC5AC2B

View File

@ -736,10 +736,10 @@
var selected = {}; var selected = {};
this.value().split(",").forEach(function(f) { this.value().split(",").forEach(function(f) {
selected[f] = true; selected[f] = true;
}) });
menu.find('input[type="checkbox"]').each(function() { menu.find('input[type="checkbox"]').each(function() {
$(this).prop("checked",selected[$(this).data('value')]) $(this).prop("checked", selected[$(this).data('value')] || false);
}) });
} }
@ -830,13 +830,7 @@
this.input.trigger('change',[this.propertyType,this.value()]); this.input.trigger('change',[this.propertyType,this.value()]);
} }
} else { } else {
this.optionSelectLabel.text(o.length + " selected"); this.optionSelectLabel.text(o.length+" selected");
if (this.optionMenu) {
this.optionMenu.find('input[type="checkbox"]').prop("checked", false);
for (const selectedOption of (this.value()?.split(",") || [])) {
this.optionMenu.find("[value='" + selectedOption + "']").find("input").prop("checked", true);
}
}
} }
} }
}, },