Merge "Synchronize the disable state of multiselect and checkbox for submission and display"

This commit is contained in:
jenkins-bot 2021-12-16 20:57:44 +00:00 committed by Gerrit Code Review
commit bb1bb4508e

View file

@ -61,7 +61,7 @@
return new OO.ui.MenuOptionWidget( {
data: option.getData(),
label: option.getLabel(),
disabled: option.isDisabled()
disabled: option.disabled // Don't take the state of parent elements into account.
} );
} );
menuTagWidget = new OO.ui.MenuTagMultiselectWidget( {
@ -78,6 +78,10 @@
menuTagWidget.on( 'change', function () {
checkboxesWidget.setValue( menuTagWidget.getValue() );
} );
// Synchronize the disable state for submission, and set the proper state of the label.
menuTagWidget.on( 'disable', function ( isDisabled ) {
checkboxesWidget.setDisabled( isDisabled );
} );
// Change the connected fieldWidget to the new one, so other scripts can infuse the layout
// and make changes to this widget.
fieldLayout.fieldWidget = menuTagWidget;