Update messenger instance if it was already created
Fixed: UI notifications don't bounce around when there is more than one
This commit is contained in:
parent
c2087af8c9
commit
70266c921b
|
@ -7,12 +7,10 @@ define(
|
||||||
|
|
||||||
return Marionette.ItemView.extend({
|
return Marionette.ItemView.extend({
|
||||||
|
|
||||||
|
|
||||||
initialize: function () {
|
initialize: function () {
|
||||||
this.listenTo(this.model, 'change', this.render);
|
this.listenTo(this.model, 'change', this.render);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
render: function () {
|
render: function () {
|
||||||
if (!this.model.get('message') || !this.model.get('sendUpdatesToClient')) {
|
if (!this.model.get('message') || !this.model.get('sendUpdatesToClient')) {
|
||||||
return;
|
return;
|
||||||
|
@ -37,7 +35,13 @@ define(
|
||||||
message.hideAfter = 0;
|
message.hideAfter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Messenger.show(message);
|
if (this.messenger) {
|
||||||
|
this.messenger.update(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
this.messenger = Messenger.show(message);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(message.message);
|
console.log(message.message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue