mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Show placeholder widget when there are no notifications"
This commit is contained in:
commit
47de8691eb
|
@ -84,6 +84,7 @@
|
|||
for ( i = 0; i < items.length; i++ ) {
|
||||
if ( items[ i ] instanceof mw.echo.ui.CrossWikiNotificationItemWidget ) {
|
||||
this.removeItems( [ items[ i ] ] );
|
||||
this.checkForEmptyNotificationsList();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -155,11 +156,7 @@
|
|||
this.clearItems();
|
||||
this.addItems( itemWidgets );
|
||||
|
||||
this.resetLoadingOption(
|
||||
itemWidgets.length === 0 ?
|
||||
mw.msg( 'echo-notification-placeholder' ) :
|
||||
''
|
||||
);
|
||||
this.checkForEmptyNotificationsList();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -196,6 +193,14 @@
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if the list of notifications is empty and udpate the placeholder
|
||||
* widget as needed.
|
||||
*/
|
||||
mw.echo.ui.NotificationsListWidget.prototype.checkForEmptyNotificationsList = function () {
|
||||
this.resetLoadingOption( this.isEmpty() ? mw.msg( 'echo-notification-placeholder' ) : '' );
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset the 'initiallyUnseen' state of all items
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue