mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Remove automatic mark-as-read-when-seen
Bug: T132525 Change-Id: I095704252eaf2f8fe71950a4cfcd42a6fce431ff
This commit is contained in:
parent
1d05d9298c
commit
2872b5eae2
|
@ -73,7 +73,6 @@
|
|||
messageController,
|
||||
messageModelManager,
|
||||
{
|
||||
markReadWhenSeen: false,
|
||||
$overlay: mw.echo.ui.$overlay,
|
||||
numItems: numMessages,
|
||||
hasUnseen: hasUnseenMessages,
|
||||
|
@ -108,7 +107,6 @@
|
|||
alertController,
|
||||
alertModelManager,
|
||||
{
|
||||
markReadWhenSeen: false,
|
||||
numItems: numAlerts,
|
||||
hasUnseen: hasUnseenAlerts,
|
||||
badgeIcon: {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* an array of both. Defaults to 'message'
|
||||
* @cfg {number} [numItems=0] How many items are in the button display
|
||||
* @cfg {boolean} [hasUnseen=false] Whether there are unseen items
|
||||
* @cfg {boolean} [markReadWhenSeen=false] Mark all notifications as read on open
|
||||
* @cfg {number} [popupWidth=450] The width of the popup
|
||||
* @cfg {string|Object} [badgeIcon] The icons to use for this button.
|
||||
* If this is a string, it will be used as the icon regardless of the state.
|
||||
|
@ -56,7 +55,6 @@
|
|||
|
||||
this.maxNotificationCount = mw.config.get( 'wgEchoMaxNotificationCount' );
|
||||
this.numItems = config.numItems || 0;
|
||||
this.markReadWhenSeen = !!config.markReadWhenSeen;
|
||||
this.badgeIcon = config.badgeIcon || {};
|
||||
this.hasRunFirstTime = false;
|
||||
|
||||
|
@ -82,8 +80,7 @@
|
|||
this.manager,
|
||||
{
|
||||
type: this.types,
|
||||
$overlay: this.$menuOverlay,
|
||||
markReadWhenSeen: this.markReadWhenSeen
|
||||
$overlay: this.$menuOverlay
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -277,7 +274,7 @@
|
|||
* Update the badge state and label based on changes to the model
|
||||
*/
|
||||
mw.echo.ui.NotificationBadgeWidget.prototype.updateBadge = function () {
|
||||
var unreadCount, cappedUnreadCount, badgeLabel, localUnread;
|
||||
var unreadCount, cappedUnreadCount, badgeLabel;
|
||||
|
||||
unreadCount = this.manager.getUnreadCounter().getCount();
|
||||
cappedUnreadCount = this.getCappedNotificationCount( unreadCount );
|
||||
|
@ -293,8 +290,7 @@
|
|||
}
|
||||
|
||||
// Check if we need to display the 'mark all unread' button
|
||||
localUnread = this.manager.hasLocalUnread();
|
||||
this.markAllReadButton.toggle( !this.markReadWhenSeen && localUnread );
|
||||
this.markAllReadButton.toggle( this.manager.hasLocalUnread() );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -352,11 +348,6 @@
|
|||
if ( widget.popup.isVisible() ) {
|
||||
widget.popup.clip();
|
||||
|
||||
// Mark notifications as 'read' if markReadWhenSeen is set to true
|
||||
if ( widget.markReadWhenSeen ) {
|
||||
widget.controller.markEntireListModelRead( 'local', true );
|
||||
}
|
||||
|
||||
// Update seen time
|
||||
return widget.controller.updateLocalSeenTime();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
* @param {mw.echo.Controller} controller Echo notifications controller
|
||||
* @param {mw.echo.dm.ModelManager} manager Model manager
|
||||
* @param {Object} [config] Configuration object
|
||||
* @cfg {boolean} [markReadWhenSeen=false] State whether the notifications are all
|
||||
* marked as read when they are seen.
|
||||
* @cfg {jQuery} [$overlay] A jQuery element functioning as an overlay
|
||||
* for popups.
|
||||
|
@ -26,7 +25,6 @@
|
|||
this.models = {};
|
||||
|
||||
// Properties
|
||||
this.markReadWhenSeen = !!config.markReadWhenSeen;
|
||||
this.$overlay = config.$overlay || this.$element;
|
||||
this.timestamp = config.timestamp || 0;
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
this.controller,
|
||||
this.model,
|
||||
{
|
||||
markReadWhenSeen: false,
|
||||
$overlay: config.$overlay,
|
||||
types: this.controller.getTypes(),
|
||||
label: mw.msg( 'notifications' ),
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
* @param {mw.echo.Controller} controller Echo notifications controller
|
||||
* @param {mw.echo.dm.NotificationItem} model Notification item model
|
||||
* @param {Object} [config] Configuration object
|
||||
* @cfg {boolean} [markReadWhenSeen=false] This option is marked as read when it is viewed
|
||||
* @cfg {jQuery} [$overlay] A jQuery element functioning as an overlay
|
||||
* for popups.
|
||||
* @cfg {boolean} [bundle=false] This notification is part of a bundle
|
||||
|
@ -27,13 +26,10 @@
|
|||
this.model = model;
|
||||
|
||||
this.bundle = !!config.bundle;
|
||||
this.markReadWhenSeen = !!config.markReadWhenSeen;
|
||||
this.$overlay = config.$overlay || this.$element;
|
||||
|
||||
this.markReadWhenSeen = !!config.markReadWhenSeen;
|
||||
|
||||
// Toggle 'mark as read' functionality
|
||||
this.toggleMarkAsReadButtons( !this.markReadWhenSeen && !this.model.isRead() );
|
||||
this.toggleMarkAsReadButtons( !this.model.isRead() );
|
||||
|
||||
// Events
|
||||
this.model.connect( this, { update: 'updateDataFromModel' } );
|
||||
|
|
Loading…
Reference in a new issue