summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/images.tmpl15
1 files changed, 7 insertions, 8 deletions
diff --git a/templates/images.tmpl b/templates/images.tmpl
index 7de8bd3..4dee28f 100644
--- a/templates/images.tmpl
+++ b/templates/images.tmpl
@@ -3,15 +3,14 @@
#extends templates.base
#def head
<script type="text/javascript" src="${settings.virtual_root}s/jquery-2.1.0.min.js"></script>
-<script type="text/javascript" src="${settings.virtual_root}s/jquery.lazyload.min.js"></script>
+<script type="text/javascript" src="${settings.virtual_root}s/jquery.lazy.min.js"></script>
<script type="text/javascript">
- function thumb_onerror(img) {
- var no_thumb = '${settings.virtual_root}s/no-thumbnail.png';
- if(img.src != no_thumb)
- img.src = no_thumb;
- }
\$(function() {
- \$('img.lazy').lazyload();
+ \$('img.lazy').Lazy({
+ onError: function(element) {
+ element.attr('src', '${settings.virtual_root}s/no-thumbnail.png');
+ }
+ });
});
</script>
#end def
@@ -20,7 +19,7 @@
#if len($files)
<div class="image-list">
#for file in $files
- <div class="image"><a href="${settings.virtual_root}f/${file.hash}${file.ext}" title="$file.filename"><img class="lazy" data-original="${settings.virtual_root}t/$file.hash" alt="$file.filename" onerror="thumb_onerror(this)" /><noscript><img src="${settings.virtual_root}t/$file.hash" alt="$file.filename" /></noscript></a></div>
+ <div class="image"><a href="${settings.virtual_root}f/${file.hash}${file.ext}" title="$file.filename"><img class="lazy" data-src="${settings.virtual_root}t/$file.hash" alt="$file.filename" /><noscript><img src="${settings.virtual_root}t/$file.hash" alt="$file.filename" /></noscript></a></div>
#end for
</div>
#else