3 * Wrapper for the RC form with hide/show links
5 * @extends OO.ui.Widget
8 * @param {mw.rcfilters.dm.ChangesListViewModel} model Changes list view model
9 * @param {jQuery} $formRoot Root element of the form to attach to
10 * @param {Object} config Configuration object
12 mw
.rcfilters
.ui
.FormWrapperWidget
= function MwRcfiltersUiFormWrapperWidget( model
, $formRoot
, config
) {
13 config
= config
|| {};
16 mw
.rcfilters
.ui
.FormWrapperWidget
.parent
.call( this, $.extend( {}, config
, {
21 this.$submitButton
= this.$element
.find( 'form input[type=submit]' );
24 this.model
.connect( this, {
25 invalidate
: 'onModelInvalidate',
26 update
: 'onModelUpdate'
30 .addClass( 'mw-rcfilters-ui-FormWrapperWidget' )
31 .addClass( 'mw-rcfilters-ui-ready' );
36 OO
.inheritClass( mw
.rcfilters
.ui
.FormWrapperWidget
, OO
.ui
.Widget
);
39 * Respond to model invalidate
41 mw
.rcfilters
.ui
.FormWrapperWidget
.prototype.onModelInvalidate = function () {
42 this.$submitButton
.prop( 'disabled', true );
46 * Respond to model update
48 mw
.rcfilters
.ui
.FormWrapperWidget
.prototype.onModelUpdate = function () {
49 this.$submitButton
.prop( 'disabled', false );