Echo should fire onInitialize event after rendering of badge

This allows skins to make modifications to the final output.
This will be used in Vector to make the Echo icon consistent with
other icons.

Bug: T257143
Change-Id: I9fe8c921956ede164d93cb1f42647cf4b80ca976
This commit is contained in:
Jon Robson 2022-09-14 17:32:01 -07:00
parent 6bbba65667
commit 2e58065ddf
2 changed files with 4 additions and 0 deletions

View file

@ -19,6 +19,9 @@ were fetched from the API.
* types: Notifications type that the badge represents. Can be 'message', 'alert' or 'all'
* controller: The instance of the controller responsible for the specific popup operations
'ext.echo.NotificationBadgeWidget.onInitialize': Fired when the badge is initialized
* badge: Instance of mw.echo.ui.NotificationBadgeWidget
'ext.echo.special.onInitialize': Fired when the special page is initialized. Note that this
is also fired whenever the special page notification display is changed, like when clicking
a filter, changing pagination, or viewing notifications for a remote wiki or page.

View file

@ -174,6 +174,7 @@
'mw-echo-ui-notificationBadgeButtonPopupWidget-' + adjustedTypeString
)
.append( this.badgeButton.$element );
mw.hook( 'ext.echo.NotificationBadgeWidget.onInitialize' ).fire( this );
};
/* Initialization */