FIX: Use observer to rerender widget instead.
This commit is contained in:
parent
0984763013
commit
92118dd1d1
|
@ -9,14 +9,11 @@ export default MountWidget.extend({
|
|||
},
|
||||
|
||||
@observes('topic.details.notification_level')
|
||||
_triggerEvent() {
|
||||
this.appEvents.trigger('topic-notifications-button:changed', {
|
||||
type: 'notification', id: this.get('topic.details.notification_level')
|
||||
});
|
||||
_queueRerender() {
|
||||
this.queueRerender();
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
this._super();
|
||||
this.dispatch('topic-notifications-button:changed', 'topic-notifications-button');
|
||||
}
|
||||
});
|
||||
|
|
|
@ -38,6 +38,11 @@ export default MountWidget.extend(Docking, {
|
|||
this.queueRerender(() => this.queueDockCheck());
|
||||
},
|
||||
|
||||
@observes('topic.details.notification_level')
|
||||
_queueRerender() {
|
||||
this.queueRerender();
|
||||
},
|
||||
|
||||
dockCheck(info) {
|
||||
const mainOffset = $('#main').offset();
|
||||
const offsetTop = mainOffset ? mainOffset.top : 0;
|
||||
|
|
|
@ -91,9 +91,7 @@ export default createWidget('topic-notifications-button', {
|
|||
topicNotificationsButtonChanged(msg) {
|
||||
switch(msg.type) {
|
||||
case 'notification':
|
||||
if (this.attrs.topic.get('details.notification_level') !== msg.id) {
|
||||
this.notificationLevelChanged(msg.id);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue