From aa94bdaeff370ca88fef9fa3d3414ab0e61da0a8 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 21 Aug 2013 14:57:22 +0200 Subject: Issue #125 : "suivant" charge articles suivants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le raccourci pour passer à l'article suivant charge automatiquement les articles suivants si on vient d'ouvrir le dernier article de la page Il reste à rajouter une option pour les charger si on se trouve en bas de la page --- app/views/javascript/main.phtml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index e81ae831a..c60093504 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -122,8 +122,13 @@ function prev_entry() { function next_entry() { old_active = $(".flux.active"); first_active = $(".flux:first"); + last_active = $(".flux:last"); new_active = old_active.nextAll (".flux:first"); + if(last_active.attr("id") == new_active.attr("id")) { + load_more_posts (); + } + if (new_active.hasClass("flux")) { toggleContent (new_active, old_active); } else if (old_active[0] === undefined && -- cgit v1.2.3