mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2025-12-11 13:54:49 -06:00
template: Avoid JavaScript error for documents with no srcset attribute.
This commit is contained in:
parent
4dacd67676
commit
27da5acfc3
@ -189,7 +189,7 @@ $(document).ready(function(){
|
|||||||
$.featherlight.defaults.contentFilters.unshift('image2');
|
$.featherlight.defaults.contentFilters.unshift('image2');
|
||||||
docs.find('figure > a:has(img)').each(function(){
|
docs.find('figure > a:has(img)').each(function(){
|
||||||
var srcset = $(this).children('img').first().attr('srcset');
|
var srcset = $(this).children('img').first().attr('srcset');
|
||||||
if (srcset.length > 0){
|
if (typeof srcset !== 'undefined'){
|
||||||
$(this).attr('data-srcset', srcset);
|
$(this).attr('data-srcset', srcset);
|
||||||
}
|
}
|
||||||
$(this).featherlight({type: 'image2', openSpeed: 150, closeSpeed: 150});
|
$(this).featherlight({type: 'image2', openSpeed: 150, closeSpeed: 150});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user