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({
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;
}