From 567d19a98934747d0817ad58a008dce7d5df0d92 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 7 Nov 2012 00:24:50 +0100 Subject: Fix issue #7 : ajout du mode endless --- app/views/javascript/main.phtml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/views/javascript/main.phtml') diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 82577bd62..e416cad95 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -32,6 +32,11 @@ function slide (new_active, old_active) { offset: new_active.position ().top + 25 }); } + + // si le dernier post est actif, on charge les suivants + if (new_active.attr ("id") == $(".post.flux:last").attr ("id")) { + load_more_posts (); + } } function add_not_read (nb) { @@ -103,9 +108,9 @@ function mark_favorite (active) { }); } -$(document).ready (function () { +function init_posts () { if (hide_posts) { - $(".post.flux .content").slideToggle (); + $(".post.flux:not(.active) .content").slideUp (); } $(".post.flux").click (function () { @@ -134,6 +139,10 @@ $(document).ready (function () { $(".post.flux .content a").click (function () { $(this).attr ('target', '_blank'); }); +} + +$(document).ready (function () { + init_posts (); // Touches de manipulation shortcut.add("", function () { -- cgit v1.2.3