[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fire 'ext.echo.badge.countChange' after DOM changes

2017-03-31 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ui/mw.echo.ui.BadgeLinkWidget.js 
b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
index d465aee..dc59e09 100644
--- a/modules/ui/mw.echo.ui.BadgeLinkWidget.js
+++ b/modules/ui/mw.echo.ui.BadgeLinkWidget.js
@@ -52,17 +52,17 @@
mw.echo.ui.BadgeLinkWidget.prototype.setCount = function ( numItems, 
label ) {
label = label || numItems;
 
+   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 );
+
if ( this.count !== numItems ) {
this.count = numItems;
 
// 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 ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/345779
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I03f1742b209305080af8784632f07dff63135d81
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Mattflaschen 
Gerrit-Reviewer: Mooeypoo 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...Echo[master]: Fire 'ext.echo.badge.countChange' after DOM changes

2017-03-30 Thread Mooeypoo (Code Review)
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