mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "(bug 45016) make sure dismiss works across all supported types"
This commit is contained in:
commit
730d98a579
|
@ -5,6 +5,8 @@
|
|||
|
||||
'optionsToken': '',
|
||||
|
||||
'dismissOutputFormats': ['web', 'email'],
|
||||
|
||||
/**
|
||||
* Change the user's preferences related to this notification type and
|
||||
* reload the page.
|
||||
|
@ -13,10 +15,19 @@
|
|||
var _this = this,
|
||||
$notification = $( notification ),
|
||||
eventType = $notification.attr( 'data-notification-type' ),
|
||||
change = 'echo-web-notifications' + eventType + '=0',
|
||||
prefRequest = {
|
||||
prefName = '',
|
||||
prefs = [],
|
||||
prefRequest = {};
|
||||
$.each( mw.echo.dismissOutputFormats, function( index, format ) {
|
||||
// Make sure output format pref exists for this event type
|
||||
prefName = 'echo-' + format + '-notifications' + eventType;
|
||||
if ( mw.user.options.exists( prefName ) ) {
|
||||
prefs.push( prefName + '=0' );
|
||||
}
|
||||
} );
|
||||
prefRequest = {
|
||||
'action': 'options',
|
||||
'change': change,
|
||||
'change': prefs.join( '|' ),
|
||||
'token': mw.echo.optionsToken,
|
||||
'format': 'json'
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue