From 6de3ef170173828d469deb2c491bf7b76099a5e0 Mon Sep 17 00:00:00 2001 From: Fabian Becker Date: Wed, 30 Oct 2013 01:24:21 +0000 Subject: [PATCH] Fix notification stacking. fixes #944 --- core/client/views/base.js | 3 ++- core/client/views/login.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/client/views/base.js b/core/client/views/base.js index d4deeb358a..41565fd4c6 100644 --- a/core/client/views/base.js +++ b/core/client/views/base.js @@ -193,7 +193,7 @@ this.renderItem(item); }, clearEverything: function () { - this.$el.find('.js-notification.notification-passive').remove(); + this.$el.find('.js-notification.notification-passive').parent().remove(); }, removeItem: function (e) { e.preventDefault(); @@ -217,6 +217,7 @@ $(this) .show() .css({height: "auto"}) + .parent() .remove(); }); } diff --git a/core/client/views/login.js b/core/client/views/login.js index e16a5531db..da9b24d9b7 100644 --- a/core/client/views/login.js +++ b/core/client/views/login.js @@ -45,6 +45,7 @@ window.location.href = msg.redirect; }, error: function (xhr) { + Ghost.notifications.clearEverything(); Ghost.notifications.addItem({ type: 'error', message: Ghost.Views.Utils.getRequestErrorMessage(xhr), @@ -102,6 +103,7 @@ window.location.href = msg.redirect; }, error: function (xhr) { + Ghost.notifications.clearEverything(); Ghost.notifications.addItem({ type: 'error', message: Ghost.Views.Utils.getRequestErrorMessage(xhr), @@ -153,6 +155,7 @@ window.location.href = msg.redirect; }, error: function (xhr) { + Ghost.notifications.clearEverything(); Ghost.notifications.addItem({ type: 'error', message: Ghost.Views.Utils.getRequestErrorMessage(xhr),