0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Passive notifications are dismissed on settings pane change

Closes #342.
It would be totally cool if we could have a Ghost.PubSub so we could hurl events there and pick them up somewhere else. For some reason all the backbone bits work on models, like `trigger` and `listenTo` and `delegateEvents`.
This commit is contained in:
Gabor Javorszky 2013-08-10 01:12:54 +01:00
parent 7cd2976dfa
commit 1d9b2d916e
2 changed files with 8 additions and 1 deletions

View file

@ -110,7 +110,11 @@
Ghost.Views.NotificationCollection = Ghost.View.extend({
el: '#flashbar',
initialize: function () {
var self = this;
this.render();
Backbone.history.on('route', function () {
self.clearEverything();
});
},
events: {
'animationend .js-notification': 'removeItem',
@ -133,6 +137,9 @@
this.model.push(item);
this.renderItem(item);
},
clearEverything: function () {
this.$el.find('.js-notification.notification-passive').fadeOut(200, function () { $(this).remove(); });
},
removeItem: function (e) {
e.preventDefault();
var self = e.currentTarget;

View file

@ -43,7 +43,7 @@
var self = this,
model;
Backbone.history.navigate('/settings/' + id);
Backbone.history.navigate('/settings/' + id, {trigger: true});
if (this.pane && id === this.pane.el.id) {
return;
}