mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 21:43:18 +08:00
FIX: broken spec
This commit is contained in:
parent
657440b8be
commit
5054065e81
|
@ -25,7 +25,9 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
_bindGlobalLevelChanged() {
|
_bindGlobalLevelChanged() {
|
||||||
this.appEvents.on("topic-notifications-button:changed", (msg) => {
|
this.appEvents.on("topic-notifications-button:changed", (msg) => {
|
||||||
if (msg.type === "notification") {
|
if (msg.type === "notification") {
|
||||||
this.set("value", msg.id);
|
if (this.get("topic.details.notification_level") !== msg.id) {
|
||||||
|
this.get("topic.details").updateNotifications(msg.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -37,7 +39,6 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
|
|
||||||
@observes("value")
|
@observes("value")
|
||||||
_notificationLevelChanged() {
|
_notificationLevelChanged() {
|
||||||
this.get("topic.details").updateNotifications(this.get("value"));
|
|
||||||
this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: this.get("value")});
|
this.appEvents.trigger('topic-notifications-button:changed', {type: 'notification', id: this.get("value")});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -47,6 +48,11 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
return iconHTML(details.icon, {class: details.key}).htmlSafe();
|
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")
|
@computed("topic.details.notification_level", "showFullTitle")
|
||||||
generatedHeadertext(notificationLevel, showFullTitle) {
|
generatedHeadertext(notificationLevel, showFullTitle) {
|
||||||
if (showFullTitle) {
|
if (showFullTitle) {
|
||||||
|
@ -75,5 +81,5 @@ export default DropdownSelectBoxComponent.extend({
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
}.property(),
|
}.property()
|
||||||
});
|
});
|
||||||
|
|
|
@ -84,6 +84,5 @@ export default MountWidget.extend(Docking, {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatch('topic:current-post-scrolled', 'timeline-scrollarea');
|
this.dispatch('topic:current-post-scrolled', 'timeline-scrollarea');
|
||||||
this.dispatch('topic-notifications-button:changed', 'topic-notifications-button');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user