discourse/app/assets/javascripts/select-kit/components/topic-notifications-button.js.es6

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
942 B
Plaintext
Raw Normal View History

import Component from "@ember/component";
export default Component.extend({
layoutName: "select-kit/templates/components/topic-notifications-button",
classNames: ["topic-notifications-button"],
appendReason: true,
2017-10-20 03:51:08 +08:00
showFullTitle: true,
placement: "bottom-start",
didInsertElement() {
this._super(...arguments);
this.appEvents.on(
"topic-notifications-button:changed",
this,
"_changeTopicNotificationLevel"
);
},
willDestroyElement() {
this._super(...arguments);
this.appEvents.off(
"topic-notifications-button:changed",
this,
"_changeTopicNotificationLevel"
);
},
_changeTopicNotificationLevel(level) {
if (level.id !== this.notificationLevel) {
this.topic.details.updateNotifications(level.id);
}
},
actions: {
changeTopicNotificationLevel(level, notification) {
this._changeTopicNotificationLevel(notification);
}
}
2017-10-20 03:51:08 +08:00
});