Skip to content
Permalink
Browse files

Fade items in when they are drawn.

chapter14-2
  • Loading branch information
tmeasday committed Oct 19, 2015
1 parent f101ae4 commit 4f57bf6bbd3f6d13b6dd90e68c0544bc8511215f
Showing with 11 additions and 0 deletions.
  1. +11 −0 client/templates/posts/posts_list.js
@@ -1,5 +1,11 @@
Template.postsList.onRendered(function () {
this.find('.wrapper')._uihooks = {
insertElement: function (node, next) {
$(node)
.hide()
.insertBefore(next)
.fadeIn();
},
moveElement: function (node, next) {
var $node = $(node), $next = $(next);
var oldTop = $node.offset().top;
@@ -33,6 +39,11 @@ Template.postsList.onRendered(function () {
// reset everything to 0, animated
$(node).addClass('animate').css('top', 0);
$inBetween.addClass('animate').css('top', 0);
},
removeElement: function(node) {
$(node).fadeOut(function() {
$(this).remove();
});
}
}
});

0 comments on commit 4f57bf6

Please sign in to comment.
You can’t perform that action at this time.