Skip to content

Commit 54ce78c

Browse files
author
patdenice
committed
Multisize
Bug fixed if $conf['derivative_url_style'] != 0 Create a pwg_ajax_thumbnails_loader function git-svn-id: http://piwigo.org/svn/trunk@13452 68402e56-0260-453c-a942-63ccdbb3a9ee
1 parent d53c5e4 commit 54ce78c

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Diff for: include/derivative.inc.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ final class DerivativeImage
9999
public $src_image;
100100

101101
private $params;
102-
private $rel_path, $rel_url, $is_cached;
102+
private $rel_path, $rel_url, $is_cached=true;
103103

104104
function __construct($type, $src_image)
105105
{
@@ -160,7 +160,6 @@ private static function build($src, &$params, &$rel_path, &$rel_url, &$is_cached
160160
// todo - what if we have a watermark maybe return a smaller size?
161161
$params = null;
162162
$rel_path = $rel_url = $src->rel_path;
163-
$is_cached = true;
164163
return;
165164
}
166165

@@ -197,7 +196,6 @@ private static function build($src, &$params, &$rel_path, &$rel_url, &$is_cached
197196
}
198197
else
199198
{
200-
$is_cached = true;
201199
$url_style = 1;
202200
}
203201
}

Diff for: themes/default/js/thumbnails.loader.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ function add_thumbnail_to_queue(img, loop) {
2121
});
2222
}
2323

24-
jQuery('img').each(function() {
25-
var img = jQuery(this);
26-
if (typeof img.data('src') != 'undefined') {
27-
add_thumbnail_to_queue(img, 0);
28-
}
29-
});
24+
function pwg_ajax_thumbnails_loader() {
25+
jQuery('img[data-src]').each(function() {
26+
add_thumbnail_to_queue(jQuery(this), 0);
27+
});
28+
}
29+
30+
jQuery(document).ready(pwg_ajax_thumbnails_loader);

Diff for: themes/default/template/thumbnails.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{if !empty($thumbnails)}{strip}
2-
{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='async'}
3-
{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='async'}
2+
{combine_script id='jquery.ajaxmanager' path='themes/default/js/plugins/jquery.ajaxmanager.js' load='footer'}
3+
{combine_script id='thumbnails.loader' path='themes/default/js/thumbnails.loader.js' require='jquery.ajaxmanager' load='footer'}
44
{*define_derivative name='derivative_params' width=160 height=90 crop=true*}
55
{html_style}
66
{*Set some sizes according to maximum thumbnail width and height*}

0 commit comments

Comments
 (0)