Mooeypoo has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/345779 )
Change subject: Fire 'ext.echo.badge.countChange' after DOM changes
..
Fire 'ext.echo.badge.countChange' after DOM changes
The event should fire after the count actually changes in the
DOM as well as the internal workings of Echo.
Change-Id: I03f1742b209305080af8784632f07dff63135d81
---
M modules/ui/mw.echo.ui.BadgeLinkWidget.js
M modules/ui/mw.echo.ui.NotificationBadgeWidget.js
2 files changed, 6 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/79/345779/1
diff --git a/modules/ui/mw.echo.ui.BadgeLinkWidget.js
b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
index d465aee..73403e1 100644
--- a/modules/ui/mw.echo.ui.BadgeLinkWidget.js
+++ b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
@@ -55,14 +55,14 @@
if ( this.count !== numItems ) {
this.count = numItems;
+ this.$element
+ .toggleClass(
'mw-echo-notifications-badge-all-read', !this.count )
+ .toggleClass(
'mw-echo-notifications-badge-long-label', label.length > 2 )
+ .attr( 'data-counter-num', this.count )
+ .attr( 'data-counter-text', label );
+
// Fire badge count change hook
mw.hook( 'ext.echo.badge.countChange' ).fire(
this.type, this.count, label );
}
-
- this.$element
- .toggleClass( 'mw-echo-notifications-badge-all-read',
!numItems )
- .toggleClass( 'mw-echo-notifications-badge-long-label',
label.length > 2 )
- .attr( 'data-counter-num', numItems )
- .attr( 'data-counter-text', label );
};
}( mediaWiki, jQuery ) );
diff --git a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
index 25170f4..e7ba5b2 100644
--- a/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
+++ b/modules/ui/mw.echo.ui.NotificationBadgeWidget.js
@@ -367,7 +367,6 @@
)
.then( this.emit.bind( this, 'finishLoading' ) )
.always( function () {
- widget.popup.clip();
// Pop pending
widget.popPending();
widget.promiseRunning = false;
--
To view, visit https://gerrit.wikimedia.org/r/345779
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I03f1742b209305080af8784632f07dff63135d81
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits