Re: Question 1
At first I was thinking you were wanting to use the active
state to manage the disabled state but I see that is not the case. Anyway, since you are already toggling the notification then the best suggestion is to just toggle the disabled
state of any inputs at the same time:
control.container.find( ':input' ).prop( 'disabled', iFrameWidth <= responsiveWidth );
That should work in most cases.
Re: Question 2
In this case where you are using the active
state to manage whether a control is available, and I refer you to this answer: https://wordpress.stackexchange.com/a/293701/8521
In short, you can override the onChangeActive
callback to manage the displaying of the notification and whether the inputs are disabled:
wp.customize.control( 'sidebar_width', function( control ) {
control.onChangeActive = function( active ) {
if ( ! displaySidebarWidth() ) {
control.notifications.add( new api.Notification( code /* ... */ ) );
} else {
control.notifications.remove( code );
}
control.container.find( ':input' ).prop( 'disabled', ! displaySidebarWidth() );
};
} );
Re: Question 3:
Yes. You can change the location of the notification by overriding the Control#getNotificationsContainerElement
method, or else rather just moving where the .customize-control-notifications-container
element is placed in the control.container
.