mirror of
https://github.com/ViViDboarder/Vivid-Casper.git
synced 2024-12-22 11:37:38 +00:00
🐛 Fixed images on infinite scroll index pages being stretched in Safari (#636)
closes #634, closes #635 - use `document.importNode` to create a clone of post card elements when pulling them in from infinite scroll pages - cloning the element means the element's owner document matches the viewed document and ensures images in the inserted post card elements are sized according to the viewed document
This commit is contained in:
parent
17ba4add5c
commit
307c334cd5
File diff suppressed because one or more lines are too long
@ -45,7 +45,10 @@
|
||||
// append contents
|
||||
var postElements = this.response.querySelectorAll('.post-card');
|
||||
postElements.forEach(function (item) {
|
||||
feedElement.appendChild(item);
|
||||
// document.importNode is important, without it the item's owner
|
||||
// document will be different which can break resizing of
|
||||
// `object-fit: cover` images in Safari
|
||||
feedElement.appendChild(document.importNode(item, true));
|
||||
});
|
||||
|
||||
// set next link
|
||||
|
Loading…
Reference in New Issue
Block a user