aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/blog/posts/_post.html.erb42
-rw-r--r--app/views/blog/posts/show.html.erb4
-rw-r--r--public/javascripts/refinerycms-blog.js9
3 files changed, 30 insertions, 25 deletions
diff --git a/app/views/blog/posts/_post.html.erb b/app/views/blog/posts/_post.html.erb
index 64afa16..f34091a 100644
--- a/app/views/blog/posts/_post.html.erb
+++ b/app/views/blog/posts/_post.html.erb
@@ -1,21 +1,23 @@
-<header>
- <h1><%= @blog_post.title %></h1>
- <details>
- <time datetime="<%= @blog_post.published_at.strftime('%Y-%m-%d') %>" class='posted_at'>
- <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
- </time>
- <% if (categories = @blog_post.categories).any? %>
- <aside class='filed_in'>
- <%= t('.filed_in') %>
- <% categories.each_with_index do |category, index| %>
- <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
- <% end %>
- </aside>
- <% end %>
- </details>
-</header>
-<%= @blog_post.body.html_safe %>
+<article id="blog_post">
+ <header>
+ <h1><%= @blog_post.title %></h1>
+ <details>
+ <time datetime="<%= @blog_post.published_at.strftime('%Y-%m-%d') %>" class='posted_at'>
+ <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
+ </time>
+ <% if (categories = @blog_post.categories).any? %>
+ <aside class='filed_in'>
+ <%= t('.filed_in') %>
+ <% categories.each_with_index do |category, index| %>
+ <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
+ <% end %>
+ </aside>
+ <% end %>
+ </details>
+ </header>
+ <%= @blog_post.body.html_safe %>
-<% if BlogPost::ShareThis.enabled? %>
- <span class="st_sharethis" displayText="ShareThis"></span>
-<% end %> \ No newline at end of file
+ <% if BlogPost::ShareThis.enabled? %>
+ <span class="st_sharethis" displayText="ShareThis"></span>
+ <% end %>
+</article> \ 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 778b011..4d82575 100644
--- a/app/views/blog/posts/show.html.erb
+++ b/app/views/blog/posts/show.html.erb
@@ -8,9 +8,9 @@
<% end %>
<% content_for :body_content_left do %>
- <article class="blog_post" id="show_blog_post">
+ <div id="show_blog_post">
<%= render 'post' %>
- </article>
+ </div>
<% if next_or_previous?(@blog_post) -%>
<nav id="next_prev_article">
<%= render 'nav' %>
diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js
index f55e279..2b887ab 100644
--- a/public/javascripts/refinerycms-blog.js
+++ b/public/javascripts/refinerycms-blog.js
@@ -1,14 +1,17 @@
$(document).ready(function(){
height = $('#show_blog_post').height();
$('#show_blog_post').height(height);
- $('#next_prev_article a:not(".home")').click(function(){
+ $('#next_prev_article a:not(".home")').live('click',function(){
url = this.href + ".js";
nav_url = $(this).attr('data-nav-url');
- $('#show_blog_post, #next_prev_article').fadeOut();
+ $('#blog_post, #next_prev_article').fadeOut();
$.ajax({
url: url,
success: function(data) {
- $('#show_blog_post').html(data).fadeIn().height('auto');
+ $('#blog_post').html(data).fadeIn()
+ $('#show_blog_post').animate({
+ height: 'auto'
+ });
$.ajax({
url: nav_url,
success: function(data) {