aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/derivative.inc.php4
-rw-r--r--themes/default/js/thumbnails.loader.js13
-rw-r--r--themes/default/template/thumbnails.tpl4
3 files changed, 10 insertions, 11 deletions
diff --git a/include/derivative.inc.php b/include/derivative.inc.php
index 2fc536475..6fbde63a2 100644
--- a/include/derivative.inc.php
+++ b/include/derivative.inc.php
@@ -99,7 +99,7 @@ final class DerivativeImage
public $src_image;
private $params;
- private $rel_path, $rel_url, $is_cached;
+ private $rel_path, $rel_url, $is_cached=true;
function __construct($type, $src_image)
{
@@ -160,7 +160,6 @@ final class DerivativeImage
// todo - what if we have a watermark maybe return a smaller size?
$params = null;
$rel_path = $rel_url = $src->rel_path;
- $is_cached = true;
return;
}
@@ -197,7 +196,6 @@ final class DerivativeImage
}
else
{
- $is_cached = true;
$url_style = 1;
}
}
diff --git a/themes/default/js/thumbnails.loader.js b/themes/default/js/thumbnails.loader.js
index e1eba51da..9483caeb6 100644
--- a/themes/default/js/thumbnails.loader.js
+++ b/themes/default/js/thumbnails.loader.js
@@ -21,9 +21,10 @@ function add_thumbnail_to_queue(img, loop) {
});
}
-jQuery('img').each(function() {
- var img = jQuery(this);
- if (typeof img.data('src') != 'undefined') {
- add_thumbnail_to_queue(img, 0);
- }
-}); \ No newline at end of file
+function pwg_ajax_thumbnails_loader() {
+ jQuery('img[data-src]').each(function() {
+ add_thumbnail_to_queue(jQuery(this), 0);
+ });
+}
+
+jQuery(document).ready(pwg_ajax_thumbnails_loader); \ No newline at end of file
diff --git a/themes/default/template/thumbnails.tpl b/themes/default/template/thumbnails.tpl
index 6f6c09122..942a5888d 100644
--- a/themes/default/template/thumbnails.tpl
+++ b/themes/default/template/thumbnails.tpl
@@ -1,6 +1,6 @@
{if !empty($thumbnails)}{strip}
-{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='async'}
-{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='async'}
+{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
+{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
{*define_derivative name='derivative_params' width=160 height=90 crop=true*}
{html_style}
{*Set some sizes according to maximum thumbnail width and height*}