From 9a3c64535b6a00ef779feed521bff830d41ddedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 22 Jan 2014 10:40:45 +0100 Subject: [PATCH] BUGFIX: regular track option was unavailable (props to @riking) --- .../views/buttons/notifications_button.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/app/assets/javascripts/discourse/views/buttons/notifications_button.js b/app/assets/javascripts/discourse/views/buttons/notifications_button.js index 6c86afced47..ef63571bae7 100644 --- a/app/assets/javascripts/discourse/views/buttons/notifications_button.js +++ b/app/assets/javascripts/discourse/views/buttons/notifications_button.js @@ -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;