aboutsummaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorJoe Sak <joe@joesak.com>2010-11-20 13:59:27 -0600
committerJoe Sak <joe@joesak.com>2010-11-20 13:59:27 -0600
commit2f94c8c08aec64403fdecf3a13d20dc35a595fb5 (patch)
treea241d59d20989fab950cc3500c22a5a23fc6f220 /public
parentcab02942d0838219ea491f61bbb3c647221e0531 (diff)
downloadrefinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.tar.gz
refinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.tar.bz2
refinerycms-blog-2f94c8c08aec64403fdecf3a13d20dc35a595fb5.zip
ajaxify the nav
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/refinerycms-blog.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js
new file mode 100644
index 0000000..f55e279
--- /dev/null
+++ b/public/javascripts/refinerycms-blog.js
@@ -0,0 +1,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;
+ })
+}) \ No newline at end of file