BUGFIX: regular track option was unavailable (props to @riking)

This commit is contained in:
Régis Hanol 2014-01-22 10:40:45 +01:00
parent 9313f27a89
commit 9a3c64535b

View File

@ -17,24 +17,21 @@ Discourse.NotificationsButton = Discourse.DropdownButtonView.extend({
dropDownContent: function() {
var contents = [], postfix = '';
if(this.get('isPrivateMessage')) {
postfix = '_pm';
}
if (this.get('isPrivateMessage')) { postfix = '_pm'; }
_.each([
['WATCHING', 'watching'],
['TRACKING', 'tracking'],
['REGULAR', 'regular'],
['MUTE', 'muted']
], function(pair){
], function(pair) {
if(pair[1] !== 'regular' && postfix !== 'pm') {
if (postfix === '_pm' && pair[1] === 'regular') { return; }
contents.push([
Discourse.Topic.NotificationLevel[pair[0]],
'topic.notifications.' + pair[1] + postfix
]);
}
contents.push([
Discourse.Topic.NotificationLevel[pair[0]],
'topic.notifications.' + pair[1] + postfix
]);
});
return contents;