diff options
| author | 2013-08-21 15:22:30 +0200 | |
|---|---|---|
| committer | 2013-08-21 15:22:30 +0200 | |
| commit | 456c95d2dbb40d358d79f426f68eb03f5f447945 (patch) | |
| tree | e3fe6053b120697e04dadb66269fd41cfa5e1d33 /public/scripts | |
| parent | 94a50086d8eb5d3336dff66b2f4efcc7bd3dfa71 (diff) | |
Fix issue #125 : "Load more" automatique
En bas de page, si l'option a été cochée (ne l'est pas par défaut), on
va charger automatiquement les articles suivants
Diffstat (limited to 'public/scripts')
| -rw-r--r-- | public/scripts/endless_mode.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/public/scripts/endless_mode.js b/public/scripts/endless_mode.js index 489b69f30..6b3ef41d5 100644 --- a/public/scripts/endless_mode.js +++ b/public/scripts/endless_mode.js @@ -1,5 +1,5 @@ var url_load_more = ""; -var load = false; +var load_more = false; function init_load_more() { url_load_more = $("a#load_more").attr("href"); @@ -12,7 +12,11 @@ function init_load_more() { } function load_more_posts () { - load = true; + if(load_more == true) { + return; + } + + load_more = true; $("#load_more").addClass("loading"); $.get (url_load_more, function (data) { $("#stream .flux:last").after($("#stream .flux", data)); @@ -22,7 +26,7 @@ function load_more_posts () { init_posts(); $("#load_more").removeClass("loading"); - load = false; + load_more = false; }); } |
