Fix notification stacking.

fixes #944
This commit is contained in:
Fabian Becker 2013-10-30 01:24:21 +00:00
parent 8a8dacb0e4
commit 6de3ef1701
2 changed files with 5 additions and 1 deletions

View File

@ -193,7 +193,7 @@
this.renderItem(item); this.renderItem(item);
}, },
clearEverything: function () { clearEverything: function () {
this.$el.find('.js-notification.notification-passive').remove(); this.$el.find('.js-notification.notification-passive').parent().remove();
}, },
removeItem: function (e) { removeItem: function (e) {
e.preventDefault(); e.preventDefault();
@ -217,6 +217,7 @@
$(this) $(this)
.show() .show()
.css({height: "auto"}) .css({height: "auto"})
.parent()
.remove(); .remove();
}); });
} }

View File

@ -45,6 +45,7 @@
window.location.href = msg.redirect; window.location.href = msg.redirect;
}, },
error: function (xhr) { error: function (xhr) {
Ghost.notifications.clearEverything();
Ghost.notifications.addItem({ Ghost.notifications.addItem({
type: 'error', type: 'error',
message: Ghost.Views.Utils.getRequestErrorMessage(xhr), message: Ghost.Views.Utils.getRequestErrorMessage(xhr),
@ -102,6 +103,7 @@
window.location.href = msg.redirect; window.location.href = msg.redirect;
}, },
error: function (xhr) { error: function (xhr) {
Ghost.notifications.clearEverything();
Ghost.notifications.addItem({ Ghost.notifications.addItem({
type: 'error', type: 'error',
message: Ghost.Views.Utils.getRequestErrorMessage(xhr), message: Ghost.Views.Utils.getRequestErrorMessage(xhr),
@ -153,6 +155,7 @@
window.location.href = msg.redirect; window.location.href = msg.redirect;
}, },
error: function (xhr) { error: function (xhr) {
Ghost.notifications.clearEverything();
Ghost.notifications.addItem({ Ghost.notifications.addItem({
type: 'error', type: 'error',
message: Ghost.Views.Utils.getRequestErrorMessage(xhr), message: Ghost.Views.Utils.getRequestErrorMessage(xhr),