diff options
-rw-r--r-- | app/controllers/blog/posts_controller.rb | 4 | ||||
-rw-r--r-- | app/views/blog/posts/_post.html.erb | 7 | ||||
-rw-r--r-- | app/views/blog/posts/show.html.erb | 5 | ||||
-rw-r--r-- | config/routes.rb | 1 | ||||
-rw-r--r-- | public/javascripts/refinerycms-blog.js | 15 |
5 files changed, 8 insertions, 24 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb index 10ec867..95ccbbe 100644 --- a/app/controllers/blog/posts_controller.rb +++ b/app/controllers/blog/posts_controller.rb @@ -28,10 +28,6 @@ class Blog::PostsController < BlogController end end end - - def update_nav - render :partial => 'nav' - end def comment if (@blog_comment = @blog_post.comments.create(params[:blog_comment])).valid? diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb index f34091a..c5e90bb 100644 --- a/app/views/blog/posts/_post.html.erb +++ b/app/views/blog/posts/_post.html.erb @@ -20,4 +20,9 @@ <% if BlogPost::ShareThis.enabled? %> <span class="st_sharethis" displayText="ShareThis"></span> <% end %> -</article>
\ No newline at end of file +</article> +<% if next_or_previous?(@blog_post) -%> + <nav id="next_prev_article"> + <%= render 'nav' %> + </nav><!-- /next_prev_article --> +<% end -%>
\ No newline at end of file diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index d277ef5..1c725d5 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -10,11 +10,6 @@ <% content_for :body_content_left do %> <div id="show_blog_post"> <%= render 'post' %> - <% if next_or_previous?(@blog_post) -%> - <nav id="next_prev_article"> - <%= render 'nav' %> - </nav><!-- /next_prev_article --> - <% end -%> </div> <% if BlogPost.comments_allowed? %> diff --git a/config/routes.rb b/config/routes.rb index 1474c3f..01fb501 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -42,7 +42,6 @@ else match 'categories/:id', :to => 'categories#show', :as => 'blog_category' match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments' get 'archive/:year/:month', :to => 'posts#archive', :as => 'archive_blog_posts' - get ':id/update_nav.js', :to => 'posts#update_nav', :as => 'update_blog_nav' end scope(:path => 'refinery', :as => 'admin', :module => 'admin') do diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js index 5b586a0..c5512d2 100644 --- a/public/javascripts/refinerycms-blog.js +++ b/public/javascripts/refinerycms-blog.js @@ -1,25 +1,14 @@ $(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(); + $('#show_blog_post').fadeOut(); $.ajax({ url: url, success: function(data) { - $('#blog_post').html(data).fadeIn(); - $.ajax({ - url: nav_url, - success: function(data) { - $('#next_prev_article').html(data).fadeIn(); - } - }) + $('#show_blog_post').html(data).fadeIn(); } }); - $('#show_blog_post').animate({ - height: 'auto' - }); return false; }) })
\ No newline at end of file |