From cf6fb7622ea99735dc5add71bdf220346648209e Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 8 Sep 2017 20:47:39 +0200 Subject: [PATCH] Replaces all notification-options like dropdowns with select-box --- .../javascripts/admin/templates/group.hbs | 2 +- app/assets/javascripts/application.js | 1 - .../categories-admin-actions.js.es6 | 62 ++++++++++++ .../categories-admin-dropdown.js.es6 | 39 -------- .../category-notification-options.js.es6 | 21 ++++ .../category-notifications-button.js.es6 | 13 --- .../group-notification-options.js.es6 | 15 +++ .../group-notifications-button.js.es6 | 11 --- .../components/notification-options.js.es6 | 53 ++++++++++ .../components/notifications-button.js.es6 | 50 ---------- .../discourse/components/select-box.js.es6 | 9 +- .../tag-notification-options.js.es6 | 22 +++++ .../tag-notifications-button.js.es6 | 11 --- .../topic-notification-options-button.js.es6 | 9 ++ .../topic-notification-options.js.es6 | 52 ++++++++++ .../topic-notifications-button.js.es6 | 9 -- .../components/topic-notifications.js.es6 | 85 ---------------- .../discourse/lib/keyboard-shortcuts.js.es6 | 8 +- .../dropdown-select-box/dropdown-header.hbs | 8 +- .../components/topic-footer-buttons.hbs | 2 +- ... => topic-notification-options-button.hbs} | 2 +- .../templates/navigation/category.hbs | 3 +- .../discourse/templates/tags/show.hbs | 4 +- .../discourse/templates/topic/unsubscribe.hbs | 2 +- .../discourse/templates/user/messages.hbs | 2 +- .../discourse/widgets/topic-timeline.js.es6 | 2 +- .../stylesheets/common/base/_topic-list.scss | 8 +- .../stylesheets/common/base/tagging.scss | 12 --- .../stylesheets/common/components/badges.scss | 15 +-- .../category-notification-options.scss | 3 + .../components/category-select-box.scss | 2 +- .../components/dropdown-select-box.scss | 66 ++++++++++++- .../components/notification-options.scss | 26 +++++ .../topic-notification-options-button.scss | 29 ++++++ .../components/topic-notifications.scss | 98 ------------------- .../stylesheets/common/topic-timeline.scss | 4 - .../stylesheets/desktop/topic-list.scss | 2 +- app/assets/stylesheets/desktop/user.scss | 12 --- app/assets/stylesheets/mobile/topic-list.scss | 8 +- ...c-notification-options-button-test.js.es6} | 2 +- 40 files changed, 396 insertions(+), 388 deletions(-) create mode 100644 app/assets/javascripts/discourse/components/categories-admin-actions.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 create mode 100644 app/assets/javascripts/discourse/components/category-notification-options.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/category-notifications-button.js.es6 create mode 100644 app/assets/javascripts/discourse/components/group-notification-options.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/group-notifications-button.js.es6 create mode 100644 app/assets/javascripts/discourse/components/notification-options.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/notifications-button.js.es6 create mode 100644 app/assets/javascripts/discourse/components/tag-notification-options.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/tag-notifications-button.js.es6 create mode 100644 app/assets/javascripts/discourse/components/topic-notification-options-button.js.es6 create mode 100644 app/assets/javascripts/discourse/components/topic-notification-options.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 delete mode 100644 app/assets/javascripts/discourse/components/topic-notifications.js.es6 rename app/assets/javascripts/discourse/templates/components/{topic-notifications-button.hbs => topic-notification-options-button.hbs} (59%) create mode 100644 app/assets/stylesheets/common/components/category-notification-options.scss create mode 100644 app/assets/stylesheets/common/components/notification-options.scss create mode 100644 app/assets/stylesheets/common/components/topic-notification-options-button.scss delete mode 100644 app/assets/stylesheets/common/components/topic-notifications.scss rename test/javascripts/acceptance/{topic-notifications-button-test.js.es6 => topic-notification-options-button-test.js.es6} (98%) diff --git a/app/assets/javascripts/admin/templates/group.hbs b/app/assets/javascripts/admin/templates/group.hbs index 1bd414e3309..dc0638ed505 100644 --- a/app/assets/javascripts/admin/templates/group.hbs +++ b/app/assets/javascripts/admin/templates/group.hbs @@ -122,7 +122,7 @@
- {{notifications-button i18nPrefix='groups.notifications' notificationLevel=model.default_notification_level}} + {{notification-options i18nPrefix='groups.notifications' value=model.default_notification_level}}
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 61c5442a930..e5d4e937841 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -66,7 +66,6 @@ //= require ./discourse/controllers/navigation/default //= require ./discourse/components/edit-category-panel //= require ./discourse/components/dropdown-button -//= require ./discourse/components/notifications-button //= require ./discourse/lib/link-mentions //= require ./discourse/components/site-header //= require ./discourse/components/d-editor diff --git a/app/assets/javascripts/discourse/components/categories-admin-actions.js.es6 b/app/assets/javascripts/discourse/components/categories-admin-actions.js.es6 new file mode 100644 index 00000000000..efe049463e3 --- /dev/null +++ b/app/assets/javascripts/discourse/components/categories-admin-actions.js.es6 @@ -0,0 +1,62 @@ +import DropdownSelectBoxComponent from "discourse/components/dropdown-select-box"; +import { iconHTML } from "discourse-common/lib/icon-library"; +import computed from "ember-addons/ember-computed-decorators"; +import { observes } from "ember-addons/ember-computed-decorators"; + +export default DropdownSelectBoxComponent.extend({ + classNames: ["categories-admin-actions"], + + icon: `${iconHTML('bars')}${iconHTML('caret-down')}`.htmlSafe(), + + generatedHeadertext: null, + + @computed + content() { + const items = [ + { + id: "create", + text: I18n.t("category.create"), + description: I18n.t("category.create_long"), + icon: "plus" + } + ]; + + const includeReorder = this.get("siteSettings.fixed_category_positions"); + if (includeReorder) { + items.push({ + id: "reorder", + text: I18n.t("categories.reorder.title"), + description: I18n.t("categories.reorder.title_long"), + icon: "random" + }); + } + + return items; + }, + + actionNames: { + create: "createCategory", + reorder: "reorderCategories" + }, + + @observes("value") + _didSelectRow() { + this.sendAction(`actionNames.${this.get("value")}`); + this.set("value", null); + }, + + @computed + templateForRow: function() { + return (rowComponent) => { + const content = rowComponent.get("content"); + + return ` +
${iconHTML(content.icon)}
+
+ ${Handlebars.escapeExpression(content.text)} + ${Handlebars.escapeExpression(content.description)} +
+ `; + }; + } +}); diff --git a/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 b/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 deleted file mode 100644 index 6a6c1a33532..00000000000 --- a/app/assets/javascripts/discourse/components/categories-admin-dropdown.js.es6 +++ /dev/null @@ -1,39 +0,0 @@ -import { iconHTML } from 'discourse-common/lib/icon-library'; -import DropdownButton from 'discourse/components/dropdown-button'; -import computed from "ember-addons/ember-computed-decorators"; - -export default DropdownButton.extend({ - buttonExtraClasses: 'no-text', - title: '', - text: iconHTML('bars') + ' ' + iconHTML('caret-down'), - classNames: ['category-notification-menu', 'category-admin-menu'], - - @computed() - dropDownContent() { - const includeReorder = this.get('siteSettings.fixed_category_positions'); - const items = [ - { id: 'create', - title: I18n.t('category.create'), - description: I18n.t('category.create_long'), - icon: 'plus' } - ]; - if (includeReorder) { - items.push({ - id: 'reorder', - title: I18n.t('categories.reorder.title'), - description: I18n.t('categories.reorder.title_long'), - icon: 'random' - }); - } - return items; - }, - - actionNames: { - create: 'createCategory', - reorder: 'reorderCategories' - }, - - clicked(id) { - this.sendAction('actionNames.' + id); - } -}); diff --git a/app/assets/javascripts/discourse/components/category-notification-options.js.es6 b/app/assets/javascripts/discourse/components/category-notification-options.js.es6 new file mode 100644 index 00000000000..d08c1726f82 --- /dev/null +++ b/app/assets/javascripts/discourse/components/category-notification-options.js.es6 @@ -0,0 +1,21 @@ +import NotificationOptionsComponent from "discourse/components/notification-options"; +import { observes } from "ember-addons/ember-computed-decorators"; +import { iconHTML } from "discourse-common/lib/icon-library"; + +export default NotificationOptionsComponent.extend({ + classNames: ["category-notification-options"], + + classNameBindings: ["hidden:is-hidden"], + hidden: Ember.computed.or("category.deleted", "site.isMobileDevice"), + + i18nPrefix: "category.notifications", + + value: Em.computed.alias("category.notification_level"), + + generatedHeadertext: iconHTML("caret-down").htmlSafe(), + + @observes("value") + _notificationLevelChanged() { + this.get("category").setNotification(this.get("value")); + }, +}); diff --git a/app/assets/javascripts/discourse/components/category-notifications-button.js.es6 b/app/assets/javascripts/discourse/components/category-notifications-button.js.es6 deleted file mode 100644 index 7be7e1bc975..00000000000 --- a/app/assets/javascripts/discourse/components/category-notifications-button.js.es6 +++ /dev/null @@ -1,13 +0,0 @@ -import NotificationsButton from 'discourse/components/notifications-button'; - -export default NotificationsButton.extend({ - classNames: ['notification-options', 'category-notification-menu'], - buttonIncludesText: false, - hidden: Em.computed.alias('category.deleted'), - notificationLevel: Em.computed.alias('category.notification_level'), - i18nPrefix: 'category.notifications', - - clicked(id) { - this.get('category').setNotification(id); - } -}); diff --git a/app/assets/javascripts/discourse/components/group-notification-options.js.es6 b/app/assets/javascripts/discourse/components/group-notification-options.js.es6 new file mode 100644 index 00000000000..cf5283394ef --- /dev/null +++ b/app/assets/javascripts/discourse/components/group-notification-options.js.es6 @@ -0,0 +1,15 @@ +import NotificationOptionsComponent from "discourse/components/notification-options"; +import { observes } from "ember-addons/ember-computed-decorators"; + +export default NotificationOptionsComponent.extend({ + classNames: ["group-notification-options"], + + value: Em.computed.alias("group.group_user.notification_level"), + + i18nPrefix: "groups.notifications", + + @observes("value") + _notificationLevelChanged() { + this.get("group").setNotification(this.get("value"), this.get("user.id")); + } +}); diff --git a/app/assets/javascripts/discourse/components/group-notifications-button.js.es6 b/app/assets/javascripts/discourse/components/group-notifications-button.js.es6 deleted file mode 100644 index ef2386086f6..00000000000 --- a/app/assets/javascripts/discourse/components/group-notifications-button.js.es6 +++ /dev/null @@ -1,11 +0,0 @@ -import NotificationsButton from 'discourse/components/notifications-button'; - -export default NotificationsButton.extend({ - classNames: ['notification-options', 'group-notification-menu'], - notificationLevel: Em.computed.alias('group.group_user.notification_level'), - i18nPrefix: 'groups.notifications', - - clicked(id) { - this.get('group').setNotification(id, this.get('user.id')); - } -}); diff --git a/app/assets/javascripts/discourse/components/notification-options.js.es6 b/app/assets/javascripts/discourse/components/notification-options.js.es6 new file mode 100644 index 00000000000..48035b51fdd --- /dev/null +++ b/app/assets/javascripts/discourse/components/notification-options.js.es6 @@ -0,0 +1,53 @@ +import DropdownSelectBoxComponent from "discourse/components/dropdown-select-box"; +import { iconHTML } from "discourse-common/lib/icon-library"; +import computed from "ember-addons/ember-computed-decorators"; +import { buttonDetails } from "discourse/lib/notification-levels"; +import { allLevels } from "discourse/lib/notification-levels"; + +export default DropdownSelectBoxComponent.extend({ + classNames: ["notification-options"], + + i18nPrefix: "", + i18nPostfix: "", + textKey: "key", + showFullTitle: true, + fullWidthOnMobile: true, + content: allLevels, + + @computed("value") + icon(value) { + const details = buttonDetails(value); + return iconHTML(details.icon, {class: details.key}).htmlSafe(); + }, + + @computed("value", "showFullTitle") + generatedHeadertext(value, showFullTitle) { + if (showFullTitle) { + const details = buttonDetails(value); + return I18n.t(`${this.get("i18nPrefix")}.${details.key}.title`); + } else { + return null; + } + }, + + @computed + templateForRow: function() { + return (rowComponent) => { + const content = rowComponent.get("content"); + const start = `${this.get("i18nPrefix")}.${content.key}${this.get("i18nPostfix")}`; + const title = I18n.t(`${start}.title`); + const description = I18n.t(`${start}.description`); + + return ` +
+ + ${iconHTML(content.icon, { class: content.key.dasherize() })} +
+
+ ${Handlebars.escapeExpression(title)} + ${Handlebars.escapeExpression(description)} +
+ `; + }; + } +}); diff --git a/app/assets/javascripts/discourse/components/notifications-button.js.es6 b/app/assets/javascripts/discourse/components/notifications-button.js.es6 deleted file mode 100644 index 2c1cacc8603..00000000000 --- a/app/assets/javascripts/discourse/components/notifications-button.js.es6 +++ /dev/null @@ -1,50 +0,0 @@ -import DropdownButton from 'discourse/components/dropdown-button'; -import { allLevels, buttonDetails } from 'discourse/lib/notification-levels'; -import { iconHTML } from 'discourse-common/lib/icon-library'; -import computed from 'ember-addons/ember-computed-decorators'; - -export default DropdownButton.extend({ - classNames: ['notification-options'], - title: '', - buttonIncludesText: true, - activeItem: Em.computed.alias('notificationLevel'), - i18nPrefix: '', - i18nPostfix: '', - - @computed - dropDownContent() { - const prefix = this.get('i18nPrefix'); - const postfix = this.get('i18nPostfix'); - - return allLevels.map(l => { - const start = `${prefix}.${l.key}${postfix}`; - return { - id: l.id, - title: I18n.t(`${start}.title`), - description: I18n.t(`${start}.description`), - icon: l.icon, - iconClass: l.key.dasherize(), - }; - }); - }, - - @computed('notificationLevel') - text(notificationLevel) { - const details = buttonDetails(notificationLevel); - const { key } = details; - const icon = iconHTML(details.icon, { class: key.dasherize() }); - - if (this.get('buttonIncludesText')) { - const prefix = this.get('i18nPrefix'); - const postfix = this.get('i18nPostfix'); - const text = I18n.t(`${prefix}.${key}${postfix}.title`); - return `${icon} ${text}`; - } else { - return `${icon} `; - } - }, - - clicked(id) { - this.set("notificationLevel", id); - } -}); diff --git a/app/assets/javascripts/discourse/components/select-box.js.es6 b/app/assets/javascripts/discourse/components/select-box.js.es6 index 93a82235121..6f2d055aeb3 100644 --- a/app/assets/javascripts/discourse/components/select-box.js.es6 +++ b/app/assets/javascripts/discourse/components/select-box.js.es6 @@ -57,19 +57,22 @@ export default Ember.Component.extend({ }; }, + @computed titleForRow: function() { return (rowComponent) => { return rowComponent.get(`content.${this.get("textKey")}`); }; - }.property(), + }, + @computed shouldHighlightRow: function() { return (rowComponent) => { const id = this._castInteger(rowComponent.get(`content.${this.get("idKey")}`)); return id === this.get("value"); }; - }.property(), + }, + @computed templateForRow: function() { return (rowComponent) => { let template = ""; @@ -83,7 +86,7 @@ export default Ember.Component.extend({ return template; }; - }.property(), + }, applyDirection() { this.$().removeClass("is-above is-below is-left-aligned is-right-aligned"); diff --git a/app/assets/javascripts/discourse/components/tag-notification-options.js.es6 b/app/assets/javascripts/discourse/components/tag-notification-options.js.es6 new file mode 100644 index 00000000000..d249a21771f --- /dev/null +++ b/app/assets/javascripts/discourse/components/tag-notification-options.js.es6 @@ -0,0 +1,22 @@ +import NotificationOptionsComponent from "discourse/components/notification-options"; +import { observes } from "ember-addons/ember-computed-decorators"; +import computed from "ember-addons/ember-computed-decorators"; +import { iconHTML } from "discourse-common/lib/icon-library"; + +export default NotificationOptionsComponent.extend({ + classNames: ["tag-notification-options"], + + i18nPrefix: "tagging.notifications", + + @observes("value") + _notificationLevelChanged() { + this.sendAction("action", this.get("value")); + }, + + @computed("value") + icon() { + return `${this._super()}${iconHTML("caret-down")}`.htmlSafe(); + }, + + generatedHeadertext: null +}); diff --git a/app/assets/javascripts/discourse/components/tag-notifications-button.js.es6 b/app/assets/javascripts/discourse/components/tag-notifications-button.js.es6 deleted file mode 100644 index b4588df710f..00000000000 --- a/app/assets/javascripts/discourse/components/tag-notifications-button.js.es6 +++ /dev/null @@ -1,11 +0,0 @@ -import NotificationsButton from 'discourse/components/notifications-button'; - -export default NotificationsButton.extend({ - classNames: ['notification-options', 'tag-notification-menu'], - buttonIncludesText: false, - i18nPrefix: 'tagging.notifications', - - clicked(id) { - this.sendAction('action', id); - } -}); diff --git a/app/assets/javascripts/discourse/components/topic-notification-options-button.js.es6 b/app/assets/javascripts/discourse/components/topic-notification-options-button.js.es6 new file mode 100644 index 00000000000..415541598c1 --- /dev/null +++ b/app/assets/javascripts/discourse/components/topic-notification-options-button.js.es6 @@ -0,0 +1,9 @@ +export default Ember.Component.extend({ + layoutName: "components/topic-notification-options-button", + + classNames: ["topic-notification-options-button"], + + showFullTitle: true, + + appendReason: true, +}); diff --git a/app/assets/javascripts/discourse/components/topic-notification-options.js.es6 b/app/assets/javascripts/discourse/components/topic-notification-options.js.es6 new file mode 100644 index 00000000000..7e7b9df1b78 --- /dev/null +++ b/app/assets/javascripts/discourse/components/topic-notification-options.js.es6 @@ -0,0 +1,52 @@ +import NotificationOptionsComponent from "discourse/components/notification-options"; +import { observes, on } from "ember-addons/ember-computed-decorators"; +import computed from "ember-addons/ember-computed-decorators"; +import { topicLevels, buttonDetails } from "discourse/lib/notification-levels"; + +export default NotificationOptionsComponent.extend({ + classNames: ["topic-notification-options"], + + content: topicLevels, + i18nPrefix: "topic.notifications", + + @on("init") + _setInitialNotificationLevel() { + this.set("value", this.get("topic.details.notification_level")); + }, + + @on("didInsertElement") + _bindGlobalLevelChanged() { + this.appEvents.on("topic-notifications-options:changed", (msg) => { + if (msg.type === "notification") { + if (this.get("topic.details.notification_level") !== msg.id) { + this.get("topic.details").updateNotifications(msg.id); + } + } + }); + }, + + @on("willDestroyElement") + _unbindGlobalLevelChanged() { + this.appEvents.off("topic-notifications-options:changed"); + }, + + @observes("value") + _notificationLevelChanged() { + this.appEvents.trigger("topic-notifications-options:changed", {type: "notification", id: this.get("value")}); + }, + + @observes("topic.details.notification_level") + _content() { + this.set("value", this.get("topic.details.notification_level")); + }, + + @computed("topic.details.notification_level", "showFullTitle") + generatedHeadertext(notificationLevel, showFullTitle) { + if (showFullTitle) { + const details = buttonDetails(notificationLevel); + return I18n.t(`topic.notifications.${details.key}.title`); + } else { + return null; + } + } +}); diff --git a/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 b/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 deleted file mode 100644 index 3622f7631e5..00000000000 --- a/app/assets/javascripts/discourse/components/topic-notifications-button.js.es6 +++ /dev/null @@ -1,9 +0,0 @@ -export default Ember.Component.extend({ - layoutName: "components/topic-notifications-button", - - classNames: ['topic-notifications-button'], - - appendReason: true, - - showFullTitle: true -}); diff --git a/app/assets/javascripts/discourse/components/topic-notifications.js.es6 b/app/assets/javascripts/discourse/components/topic-notifications.js.es6 deleted file mode 100644 index a1bdc7cbc86..00000000000 --- a/app/assets/javascripts/discourse/components/topic-notifications.js.es6 +++ /dev/null @@ -1,85 +0,0 @@ -import DropdownSelectBoxComponent from "discourse/components/dropdown-select-box"; -import { observes, on } from "ember-addons/ember-computed-decorators"; -import computed from "ember-addons/ember-computed-decorators"; -import { topicLevels, buttonDetails } from 'discourse/lib/notification-levels'; -import { iconHTML } from 'discourse-common/lib/icon-library'; - -export default DropdownSelectBoxComponent.extend({ - classNames: ["topic-notifications"], - - content: topicLevels, - - i18nPrefix: 'topic.notifications', - i18nPostfix: '', - - textKey: "key", - showFullTitle: true, - fullWidthOnMobile: true, - - @on("init") - _setInitialNotificationLevel() { - this.set("value", this.get("topic.details.notification_level")); - }, - - @on("didInsertElement") - _bindGlobalLevelChanged() { - this.appEvents.on("topic-notifications-button:changed", (msg) => { - if (msg.type === "notification") { - if (this.get("topic.details.notification_level") !== msg.id) { - this.get("topic.details").updateNotifications(msg.id); - } - } - }); - }, - - @on("willDestroyElement") - _unbindGlobalLevelChanged() { - this.appEvents.off("topic-notifications-button:changed"); - }, - - @observes("value") - _notificationLevelChanged() { - this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: this.get("value")}); - }, - - @computed("topic.details.notification_level") - icon(notificationLevel) { - const details = buttonDetails(notificationLevel); - return iconHTML(details.icon, {class: details.key}).htmlSafe(); - }, - - @observes("topic.details.notification_level") - _content() { - this.set("value", this.get("topic.details.notification_level")); - }, - - @computed("topic.details.notification_level", "showFullTitle") - generatedHeadertext(notificationLevel, showFullTitle) { - if (showFullTitle) { - const details = buttonDetails(notificationLevel); - return I18n.t(`topic.notifications.${details.key}.title`); - } else { - return null; - } - }, - - templateForRow: function() { - return (rowComponent) => { - const content = rowComponent.get("content"); - const start = `${this.get('i18nPrefix')}.${content.key}${this.get('i18nPostfix')}`; - const title = I18n.t(`${start}.title`); - const description = I18n.t(`${start}.description`); - - return ` -
- - ${iconHTML(content.icon, { class: content.key })} -
-
- ${title} - ${description} -
- `; - }; - }.property() -}); diff --git a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 index 6ae50d04755..afaba557a53 100644 --- a/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 +++ b/app/assets/javascripts/discourse/lib/keyboard-shortcuts.js.es6 @@ -198,19 +198,19 @@ export default { }, setTrackingToMuted(event) { - this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: 0, event}); + this.appEvents.trigger('topic-notifications-options:changed', {type: 'notification', id: 0, event}); }, setTrackingToRegular(event) { - this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: 1, event}); + this.appEvents.trigger('topic-notifications-options:changed', {type: 'notification', id: 1, event}); }, setTrackingToTracking(event) { - this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: 2, event}); + this.appEvents.trigger('topic-notifications-options:changed', {type: 'notification', id: 2, event}); }, setTrackingToWatching(event) { - this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: 3, event}); + this.appEvents.trigger('topic-notifications-options:changed', {type: 'notification', id: 3, event}); }, sendToTopicListItemView(action) { diff --git a/app/assets/javascripts/discourse/templates/components/dropdown-select-box/dropdown-header.hbs b/app/assets/javascripts/discourse/templates/components/dropdown-select-box/dropdown-header.hbs index f62d5bd35d7..034ae8912b7 100644 --- a/app/assets/javascripts/discourse/templates/components/dropdown-select-box/dropdown-header.hbs +++ b/app/assets/javascripts/discourse/templates/components/dropdown-select-box/dropdown-header.hbs @@ -1,5 +1,11 @@ -