#27 fix issue with description on lazy loaded images
This commit is contained in:
+2
-27
@@ -32,33 +32,8 @@
|
||||
<%
|
||||
// Load the first 50 thumbnails, then load more as the user scrolls. See web.js
|
||||
items.slice(0, 50).forEach(item => {
|
||||
// Replace HTML entities for description text (if any)
|
||||
item.description = item.description.replace(/'/g, ''')
|
||||
if (item.video) { %>
|
||||
<a data-video='<%- item.video %>'
|
||||
<% if (item.description) { %>
|
||||
data-sub-html='<p><%= item.description %></p>'
|
||||
<% } %>
|
||||
<% if (item.downloadUrl) { %>
|
||||
data-download-url="<%- item.downloadUrl %>"
|
||||
<% } %>
|
||||
>
|
||||
<img alt="" src="<%- item.thumbnailUrl %>"/>
|
||||
<div class="play-icon"></div>
|
||||
</a>
|
||||
<% } else { %>
|
||||
<a href="<%- item.previewUrl %>"
|
||||
<% if (item.description) { %>
|
||||
data-sub-html='<p><%= item.description %></p>'
|
||||
<% } %>
|
||||
<% if (item.downloadUrl) { %>
|
||||
data-download-url="<%- item.downloadUrl %>"
|
||||
<% } %>
|
||||
>
|
||||
<img alt="" src="<%- item.thumbnailUrl %>"/>
|
||||
</a>
|
||||
<% }
|
||||
}) %>
|
||||
%><%- item %>
|
||||
<% }) %>
|
||||
</div>
|
||||
<script src="/share/static/web.js"></script>
|
||||
<script src="/share/static/lg/lightgallery.min.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user