discourse/app/assets/javascripts/select-kit/components/topic-notifications-options...

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

33 lines
920 B
Plaintext
Raw Normal View History

import NotificationsButtonComponent from "select-kit/components/notifications-button";
2017-10-19 15:51:08 -04:00
import { topicLevels } from "discourse/lib/notification-levels";
import { computed } from "@ember/object";
2017-10-19 15:51:08 -04:00
export default NotificationsButtonComponent.extend({
pluginApiIdentifiers: ["topic-notifications-options"],
classNames: ["topic-notifications-options"],
2017-10-19 15:51:08 -04:00
content: topicLevels,
selectKitOptions: {
i18nPrefix: "i18nPrefix",
i18nPostfix: "i18nPostfix"
},
i18nPrefix: "topic.notifications",
2019-03-20 07:50:13 -04:00
i18nPostfix: computed("topic.archetype", function() {
return this.topic.archetype === "private_message" ? "_pm" : "";
}),
2017-10-19 15:51:08 -04:00
didInsertElement() {
this._super(...arguments);
2017-10-19 15:51:08 -04:00
this.appEvents.on("topic-notifications-button:changed", this, "onSelect");
},
willDestroyElement() {
this._super(...arguments);
this.appEvents.off("topic-notifications-button:changed", this, "onSelect");
}
2017-10-19 15:51:08 -04:00
});