aboutsummaryrefslogtreecommitdiff
path: root/public/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 14:17:11 -0800
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-04 14:17:11 -0800
commitfb07117b78bb0ff2d97d4a042625b8600e3551c6 (patch)
treeee8b855f54f06b6415362e0c7e23840d69a3131e /public/scripts
parenta4881b2a93615b97bab3da39514983a837c495bf (diff)
parent1a209f1e9b791d5339d0968b55e78844281daf0e (diff)
Merge pull request #224 from Alkarex/manualLazyload
LazyLoad manuel pour les articles repliƩs
Diffstat (limited to 'public/scripts')
-rw-r--r--public/scripts/main.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js
index ce589326e..684239568 100644
--- a/public/scripts/main.js
+++ b/public/scripts/main.js
@@ -24,6 +24,13 @@ function redirect (url, new_tab) {
}
function toggleContent (new_active, old_active) {
+ if (does_lazyload) {
+ new_active.find('img[data-original]').each(function() {
+ this.setAttribute('src', this.getAttribute('data-original'));
+ this.removeAttribute('data-original');
+ });
+ }
+
old_active.removeClass ("active");
if (old_active[0] != new_active[0]) {
new_active.addClass ("active");
@@ -62,10 +69,6 @@ function toggleContent (new_active, old_active) {
new_scroll = $(box_to_move).scrollTop (new_pos).scrollTop ();
}
- if ((new_scroll === old_scroll) && $.fn.lazyload) {
- $(window).trigger ("scroll"); //When no scroll was done, generate fake scroll event for LazyLoad to load images
- }
-
if (auto_mark_article) {
mark_read(new_active, true);
}
@@ -226,7 +229,7 @@ function inMarkViewport(flux, box_to_follow, relative_follow) {
function init_posts () {
init_img ();
- if (does_lazyload) {
+ if ($.fn.lazyload) {
if (is_global_mode()) {
$(".flux .content img").lazyload({
container: $("#panel")