mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Merge "Clicking Echo badge should close ULS dialog"
This commit is contained in:
commit
586e1291bf
|
@ -234,7 +234,9 @@ function initDesktop() {
|
|||
$badge = $( this ),
|
||||
clickedSection = $badge.parent().prop( 'id' ) === 'pt-notifications-alert' ? 'alert' : 'message';
|
||||
if ( e.which !== 1 || $badge.data( 'clicked' ) ) {
|
||||
return false;
|
||||
// Do not return false (as that calls stopPropagation)
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
$badge.data( 'clicked', true );
|
||||
|
@ -270,8 +272,8 @@ function initDesktop() {
|
|||
// Un-dim badge if loading failed
|
||||
$badge.removeClass( 'mw-echo-notifications-badge-dimmed' );
|
||||
} );
|
||||
// Prevent default
|
||||
return false;
|
||||
// Prevent default. Do not return false (as that calls stopPropagation)
|
||||
e.preventDefault();
|
||||
} );
|
||||
|
||||
function pollForNotificationCountUpdates() {
|
||||
|
|
|
@ -52,6 +52,18 @@
|
|||
|
||||
mw.echo.ui.BadgeLinkWidget.static.tagName = 'a';
|
||||
|
||||
/**
|
||||
* Overrides ButtonElement.prototype.onClick so that it doesn't call ev.stopPropagation.
|
||||
* This ensures the dialog dismisses other open overlays e.g. ULS (See T295796 for more
|
||||
* information).
|
||||
*
|
||||
* @inheritDoc
|
||||
*/
|
||||
mw.echo.ui.BadgeLinkWidget.prototype.onClick = function ( ev ) {
|
||||
ev.preventDefault();
|
||||
this.emit( 'click' );
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the count labels for this button.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue