Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/151990
Change subject: Hygiene: use self where possible
......................................................................
Hygiene: use self where possible
Change-Id: I30e9d6ea8b59e168fc5b151f215c3592f475bedf
---
M modules/overlay/ext.echo.overlay.js
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/90/151990/1
diff --git a/modules/overlay/ext.echo.overlay.js
b/modules/overlay/ext.echo.overlay.js
index 4fc7889..f174b95 100644
--- a/modules/overlay/ext.echo.overlay.js
+++ b/modules/overlay/ext.echo.overlay.js
@@ -52,6 +52,7 @@
},
_getMarkAsReadButton: function() {
+ var self = this;
return $( '<button>' )
.addClass( 'mw-ui-button' )
.attr( 'id', 'mw-echo-mark-read-button' )
@@ -66,7 +67,7 @@
var count;
if (
result.query.echomarkread.count !== undefined ) {
count =
result.query.echomarkread.count;
-
mw.echo.overlay.updateCount( count, result.query.echomarkread.rawcount );
+ self.updateCount(
count, result.query.echomarkread.rawcount );
// Reset header to
'Notifications'
$(
'#mw-echo-overlay-title-text' ).html( mw.msg( 'echo-overlay-title' ) );
}
@@ -157,7 +158,7 @@
// database updates. If the count is more than the
maximum, it could
// be thousands.
includeMarkAsReadButton = overflow &&
- unreadRawTotalCount <
mw.echo.overlay.configuration[ 'max-notification-count' ];
+ unreadRawTotalCount < this.configuration[
'max-notification-count' ];
if ( includeMarkAsReadButton ) {
// Add the 'mark all as read' button to the
title area
$title.append( this._getMarkAsReadButton() );
@@ -209,7 +210,7 @@
$ul = $( '<ul>' ).addClass(
'mw-echo-notifications' );
if ( unreadTotalCount !== undefined ) {
- mw.echo.overlay.updateCount(
unreadTotalCount, unreadRawTotalCount );
+ self.updateCount( unreadTotalCount,
unreadRawTotalCount );
}
$ul.css( 'max-height', notificationLimit * 95 +
'px' );
$.each( notifications.index, function ( index,
id ) {
@@ -296,6 +297,7 @@
* @param {array} unread a list of unread ids
*/
markAllAsRead: function( unread ) {
+ var self = this;
// only need to mark as read if there is unread item
if ( unread.length > 0 ) {
this.api.post( mw.echo.desktop.appendUseLang( {
@@ -306,7 +308,7 @@
var count;
if ( result.query.echomarkread.count
!== undefined ) {
count =
result.query.echomarkread.count;
- mw.echo.overlay.updateCount(
count, result.query.echomarkread.rawcount );
+ self.updateCount( count,
result.query.echomarkread.rawcount );
}
} );
}
--
To view, visit https://gerrit.wikimedia.org/r/151990
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I30e9d6ea8b59e168fc5b151f215c3592f475bedf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits