diff options
| author | 2013-11-17 11:23:23 +0100 | |
|---|---|---|
| committer | 2013-11-17 12:42:10 +0100 | |
| commit | fb5bcbe044a8273d54fdc7bc525106a2ef797fc5 (patch) | |
| tree | 9d85c10139cda3905bde9bdaeb27a15a3eb8a58d | |
| parent | b592b60e32b0a537321e5220acdf117f9fab8f5f (diff) | |
Corrige bug mode endless dans la vue globale
Problème d'initialisation après le remaniement du code
Corrige #275
| -rw-r--r-- | public/scripts/main.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js index 159bf48b3..2794e2913 100644 --- a/public/scripts/main.js +++ b/public/scripts/main.js @@ -478,17 +478,18 @@ function init_notifications() { //<endless_mode> var url_load_more = "", - load_more = false; + load_more = false, + box_load_more = null; function load_more_posts() { - if (load_more || url_load_more === '') { + if (load_more || url_load_more === '' || box_load_more === null) { return; } load_more = true; $('#load_more').addClass('loading'); $.get(url_load_more, function (data) { - $stream.children('.flux:last').after($('#stream', data).children('.flux, .day')); + box_load_more.children('.flux:last').after($('#stream', data).children('.flux, .day')); $('.pagination').replaceWith($('.pagination', data)); $('[id^=day_]').each(function (i) { @@ -496,7 +497,7 @@ function load_more_posts() { if (ids.length > 1) $('[id="' + this.id + '"]:gt(0)').remove(); }); - init_load_more(); + init_load_more(box_load_more); init_lazyload(); $('#load_more').removeClass('loading'); @@ -504,7 +505,7 @@ function load_more_posts() { }); } -function init_load_more() { +function init_load_more(box) { var $next_link = $("#load_more"); if (!$next_link.length) { // no more article to load @@ -512,6 +513,8 @@ function init_load_more() { return; } + box_load_more = box; + url_load_more = $next_link.attr("href"); var $prefetch = $('#prefetch'); if ($prefetch.attr('href') !== url_load_more) { @@ -616,7 +619,7 @@ function init_all() { init_templates(); init_notifications(); init_actualize(); - init_load_more(); + init_load_more($stream); if (use_persona) { init_persona(); } |
