From 1b9f16771c9feaf44c088f58f598fcc08b7bbea8 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Fri, 8 Nov 2013 20:32:35 +0100 Subject: Fix issue #208: chargement dynamique des jours MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Les indications de jours (aujourd'hui, hier, à partir d'avant-hier) sont maintenant chargés dynamiquement --- app/views/helpers/view/normal_view.phtml | 6 +++--- public/scripts/main.js | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/helpers/view/normal_view.phtml b/app/views/helpers/view/normal_view.phtml index 2f6748263..ad6154163 100644 --- a/app/views/helpers/view/normal_view.phtml +++ b/app/views/helpers/view/normal_view.phtml @@ -16,21 +16,21 @@ if (isset ($this->entryPaginator) && !$this->entryPaginator->isEmpty ()) { isDay (Days::TODAY)) { ?> -
+
- currentName; ?>
isDay (Days::YESTERDAY)) { ?> -
+
- currentName; ?>
isDay (Days::BEFORE_YESTERDAY)) { ?> -
+
currentName; ?>
diff --git a/public/scripts/main.js b/public/scripts/main.js index e408b4dce..40c802ae7 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -477,9 +477,14 @@ function load_more_posts() { load_more = true; $('#load_more').addClass('loading'); $.get(url_load_more, function (data) { - $stream.children('.flux:last').after($('#stream', data).children('.flux')); + $stream.children('.flux:last').after($('#stream', data).children('.flux, .day')); $('.pagination').replaceWith($('.pagination', data)); + $('[id^=day_]').each(function (i) { + var ids = $('[id="' + this.id + '"]'); + if (ids.length > 1) $('[id="' + this.id + '"]:gt(0)').remove(); + }); + init_load_more(); init_lazyload(); -- cgit v1.2.3