aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/refinerycms-blog.js
blob: 2b887ab2ea285666580b28d1380e03a2107f550e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$(document).ready(function(){
  height = $('#show_blog_post').height();
  $('#show_blog_post').height(height);
  $('#next_prev_article a:not(".home")').live('click',function(){
    url = this.href + ".js";
    nav_url = $(this).attr('data-nav-url');
    $('#blog_post, #next_prev_article').fadeOut();
    $.ajax({
      url: url,
      success: function(data) {
        $('#blog_post').html(data).fadeIn()
        $('#show_blog_post').animate({
          height: 'auto'
        });
        $.ajax({
          url: nav_url,
          success: function(data) {
            $('#next_prev_article').html(data).fadeIn();
          }
        })
      }
    });
    return false;
  })
})