0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #378 from javorszky/iss342

Passive notifications are dismissed on settings pane change
This commit is contained in:
Hannah Wolfe 2013-08-17 11:30:21 -07:00
commit 24fbb45c23
2 changed files with 8 additions and 1 deletions

View file

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

View file

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