mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Ability to spawn multiple notifications
Fixes #696 - Updated notifications logic to deal directly with the individual notification, rather than the notification container.
This commit is contained in:
parent
750c19014a
commit
9f4122d0cd
@ -178,12 +178,14 @@
|
||||
renderItem: function (item) {
|
||||
var itemView = new Ghost.Views.Notification({ model: item }),
|
||||
height,
|
||||
self = this;
|
||||
this.$el.html(itemView.render().el).css({height: 0});
|
||||
height = this.$('.js-notification').hide().outerHeight(true);
|
||||
this.$el.animate({height: height}, 250, function () {
|
||||
$(this).css({height: "auto"});
|
||||
self.$('.js-notification').fadeIn(250);
|
||||
$notification = $(itemView.render().el);
|
||||
|
||||
this.$el.append($notification);
|
||||
height = $notification.hide().outerHeight(true);
|
||||
$notification.animate({height: height}, 250, function () {
|
||||
$(this)
|
||||
.css({height: "auto"})
|
||||
.fadeIn(250);
|
||||
});
|
||||
},
|
||||
addItem: function (item) {
|
||||
@ -216,23 +218,21 @@
|
||||
});
|
||||
});
|
||||
} else {
|
||||
this.$el.slideUp(250, function () {
|
||||
$(this).show().css({height: "auto"});
|
||||
$(self).remove();
|
||||
$(self).slideUp(250, function () {
|
||||
$(this)
|
||||
.show()
|
||||
.css({height: "auto"})
|
||||
.remove();
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
closePassive: function (e) {
|
||||
var height = this.$('.js-notification').outerHeight(true),
|
||||
self = this;
|
||||
this.$el.css({height: height});
|
||||
$(e.currentTarget).parent().fadeOut(250, function () {
|
||||
$(this).remove();
|
||||
self.$el.slideUp(250, function () {
|
||||
$(this).show().css({height: "auto"});
|
||||
$(e.currentTarget)
|
||||
.parent()
|
||||
.fadeOut(250)
|
||||
.slideUp(250, function () {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
},
|
||||
closePersistent: function (e) {
|
||||
var self = e.currentTarget,
|
||||
|
Loading…
Reference in New Issue
Block a user