summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-11-17 11:23:23 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-11-17 11:23:23 +0100
commitc4746cff9afcded4e9fe03a806c9a14a4341aac3 (patch)
tree7915322e4ecf22d533cbd2d8953471562c5f09a7
parent402ca402c853b323d67ad823b8507aaedf814912 (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.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js
index b86b1c856..88d46b2f9 100644
--- a/public/scripts/main.js
+++ b/public/scripts/main.js
@@ -480,17 +480,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) {
@@ -498,7 +499,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');
@@ -506,7 +507,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
@@ -514,6 +515,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) {
@@ -618,7 +621,7 @@ function init_all() {
init_templates();
init_notifications();
init_actualize();
- init_load_more();
+ init_load_more($stream);
if (use_persona) {
init_persona();
}