mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05: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
1 changed files with 18 additions and 18 deletions
|
@ -178,12 +178,14 @@
|
||||||
renderItem: function (item) {
|
renderItem: function (item) {
|
||||||
var itemView = new Ghost.Views.Notification({ model: item }),
|
var itemView = new Ghost.Views.Notification({ model: item }),
|
||||||
height,
|
height,
|
||||||
self = this;
|
$notification = $(itemView.render().el);
|
||||||
this.$el.html(itemView.render().el).css({height: 0});
|
|
||||||
height = this.$('.js-notification').hide().outerHeight(true);
|
this.$el.append($notification);
|
||||||
this.$el.animate({height: height}, 250, function () {
|
height = $notification.hide().outerHeight(true);
|
||||||
$(this).css({height: "auto"});
|
$notification.animate({height: height}, 250, function () {
|
||||||
self.$('.js-notification').fadeIn(250);
|
$(this)
|
||||||
|
.css({height: "auto"})
|
||||||
|
.fadeIn(250);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addItem: function (item) {
|
addItem: function (item) {
|
||||||
|
@ -216,22 +218,20 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$el.slideUp(250, function () {
|
$(self).slideUp(250, function () {
|
||||||
$(this).show().css({height: "auto"});
|
$(this)
|
||||||
$(self).remove();
|
.show()
|
||||||
|
.css({height: "auto"})
|
||||||
|
.remove();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
closePassive: function (e) {
|
closePassive: function (e) {
|
||||||
var height = this.$('.js-notification').outerHeight(true),
|
$(e.currentTarget)
|
||||||
self = this;
|
.parent()
|
||||||
this.$el.css({height: height});
|
.fadeOut(250)
|
||||||
$(e.currentTarget).parent().fadeOut(250, function () {
|
.slideUp(250, function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
self.$el.slideUp(250, function () {
|
|
||||||
$(this).show().css({height: "auto"});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
closePersistent: function (e) {
|
closePersistent: function (e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue