Permalink
Browse files

animation fix

  • Loading branch information...
1 parent 07c9fa3 commit b838f538939b302f9c9cf8782bf03e57f2c3a43e @haithembelhaj committed Apr 9, 2012
Showing with 2 additions and 18 deletions.
  1. +1 −11 js/app.coffee
  2. +1 −7 js/app.js
View
@@ -45,8 +45,6 @@ Model.Projects =
else
callback @repos[id]
-
-
#init models
$.get 'models/posts.json',(data)->
Model.Posts.models = data
@@ -63,12 +61,6 @@ View.Posts =
el: $('.content .posts')
template: $('#post-template').html()
-
- empty: (next)->
- $('.content .posts').fadeOut ()->
- $(@).empty()
- next()
-
renderLast: ()->
for post in Model.Posts.models.reverse().slice(-2)
@@ -91,15 +83,13 @@ View.Posts =
post.content = converter.makeHtml data
View.Posts.renderHelper post
-
renderLinks: (id)->
next = Model.Posts.next(id)
prev = Model.Posts.prev(id)
if next
$('.posts article').append '<a class="next navigation" href="#/posts/'+next+'">></a>'
if prev
$('.posts article').append '<a class="prev navigation" href="#/posts/'+prev+'"><</a>'
-
renderHelper: (model)->
View.Posts.el.append(Mustache.render(View.Posts.template , model)).fadeIn()
@@ -132,7 +122,7 @@ View.empty = (next)->
router = new Router()
router.route '/posts/:id', (id)->
- View.Posts.empty ()->
+ View.empty ()->
View.Posts.render id, true
router.route '/blog', ->
View
@@ -71,12 +71,6 @@ $.get('models/projects.json', function(data) {
View.Posts = {
el: $('.content .posts'),
template: $('#post-template').html(),
- empty: function(next) {
- return $('.content .posts').fadeOut(function() {
- $(this).empty();
- return next();
- });
- },
renderLast: function() {
var post, _i, _len, _ref;
_ref = Model.Posts.models.reverse().slice(-2);
@@ -154,7 +148,7 @@ View.empty = function(next) {
router = new Router();
router.route('/posts/:id', function(id) {
- return View.Posts.empty(function() {
+ return View.empty(function() {
return View.Posts.render(id, true);
});
});

0 comments on commit b838f53

Please sign in to comment.