5 * @extends OO.ui.Widget
6 * @mixins OO.ui.mixin.PendingElement
9 * @param {mw.rcfilters.dm.ChangesListViewModel} model View model
10 * @param {jQuery} $changesListRoot Root element of the changes list to attach to
11 * @param {Object} config Configuration object
13 mw
.rcfilters
.ui
.ChangesListWrapperWidget
= function MwRcfiltersUiChangesListWrapperWidget( model
, $changesListRoot
, config
) {
14 config
= config
|| {};
17 mw
.rcfilters
.ui
.ChangesListWrapperWidget
.parent
.call( this, $.extend( {}, config
, {
18 $element
: $changesListRoot
21 OO
.ui
.mixin
.PendingElement
.call( this, config
);
26 this.model
.connect( this, {
27 invalidate
: 'onModelInvalidate',
28 update
: 'onModelUpdate'
34 OO
.inheritClass( mw
.rcfilters
.ui
.ChangesListWrapperWidget
, OO
.ui
.Widget
);
35 OO
.mixinClass( mw
.rcfilters
.ui
.ChangesListWrapperWidget
, OO
.ui
.mixin
.PendingElement
);
38 * Respond to model invalidate
40 mw
.rcfilters
.ui
.ChangesListWrapperWidget
.prototype.onModelInvalidate = function () {
45 * Respond to model update
47 * @param {jQuery|string} changesListContent The content of the updated changes list
49 mw
.rcfilters
.ui
.ChangesListWrapperWidget
.prototype.onModelUpdate = function ( changesListContent
) {
50 var isEmpty
= changesListContent
=== 'NO_RESULTS';
51 this.$element
.toggleClass( 'mw-changeslist', !isEmpty
);
52 this.$element
.toggleClass( 'mw-changeslist-empty', isEmpty
);
53 this.$element
.empty().append(
55 document
.createTextNode( mw
.message( 'recentchanges-noresult' ).text() ) :