aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/templates/common_elements.html
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/templates/common_elements.html')
-rw-r--r--youtube/templates/common_elements.html8
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html
index 58580a3..0587ce3 100644
--- a/youtube/templates/common_elements.html
+++ b/youtube/templates/common_elements.html
@@ -14,14 +14,18 @@
{%- endif -%}
{% endmacro %}
-{% macro item(info, description=false, horizontal=true, include_author=true, include_badges=true) %}
+{% macro item(info, description=false, horizontal=true, include_author=true, include_badges=true, lazy_load=false) %}
<div class="item-box {{ info['type'] + '-item-box' }} {{'horizontal-item-box' if horizontal else 'vertical-item-box'}} {{'has-description' if description else 'no-description'}}">
{% if info['error'] %}
{{ info['error'] }}
{% else %}
<div class="item {{ info['type'] + '-item' }}">
<a class="thumbnail-box" href="{{ info['url'] }}" title="{{ info['title'] }}">
- <img class="thumbnail-img" src="{{ info['thumbnail'] }}">
+ {% if lazy_load %}
+ <img class="thumbnail-img lazy" data-src="{{ info['thumbnail'] }}">
+ {% else %}
+ <img class="thumbnail-img" src="{{ info['thumbnail'] }}">
+ {% endif %}
{% if info['type'] != 'channel' %}
<div class="thumbnail-info">
<span>{{ (info['video_count']|commatize + ' videos') if info['type'] == 'playlist' else info['duration'] }}</span>