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