aboutsummaryrefslogtreecommitdiffstats
path: root/app/assets/javascripts/refinery/blog/frontend.js
diff options
context:
space:
mode:
authorUģis Ozols <ugis.ozolss@gmail.com>2011-08-03 13:17:16 +0300
committerUģis Ozols <ugis.ozolss@gmail.com>2011-08-03 13:17:16 +0300
commit476ad3f15810455fd40cc8374af1a253471b296c (patch)
treec3cc8e7993364f7d0fb9362cf6c0bc6e99873e44 /app/assets/javascripts/refinery/blog/frontend.js
parent806aef18583a4fcdc5a88a6e2acfe6b779abea4c (diff)
downloadrefinerycms-blog-476ad3f15810455fd40cc8374af1a253471b296c.tar.gz
refinerycms-blog-476ad3f15810455fd40cc8374af1a253471b296c.tar.bz2
refinerycms-blog-476ad3f15810455fd40cc8374af1a253471b296c.zip
WIP - use asset pipeline.
Diffstat (limited to 'app/assets/javascripts/refinery/blog/frontend.js')
-rw-r--r--app/assets/javascripts/refinery/blog/frontend.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/refinery/blog/frontend.js b/app/assets/javascripts/refinery/blog/frontend.js
new file mode 100644
index 0000000..269f70f
--- /dev/null
+++ b/app/assets/javascripts/refinery/blog/frontend.js
@@ -0,0 +1,25 @@
+$(document).ready(function(){
+ $('#show_blog_post').height($('#show_blog_post').height());
+
+ $('#next_prev_article a:not(".home")').live('click', function(){
+ url = this.href + ".js";
+ $('#show_blog_post > *').fadeOut();
+ $.ajax({
+ url: url,
+ success: function(data) {
+ $('#show_blog_post').html(data);
+ new_height = 0;
+ $('#show_blog_post > *').each(function(){
+ new_height += $(this).height()
+ });
+ $('#show_blog_post').animate({
+ height: new_height
+ });
+ }
+ });
+ $('html, body').animate({
+ scrollTop: $('body').offset().top
+ }, 2000);
+ return false;
+ })
+}) \ No newline at end of file