Skip to content

Commit 41bb7c3

Browse files
authored
Merge pull request #3845 from AlchemyCMS/remove-lazy-loading-from-thumbnail
Remove lazy loading from thumbnail
2 parents 96cdfd4 + c8054ff commit 41bb7c3

6 files changed

Lines changed: 5 additions & 16 deletions

File tree

app/assets/builds/alchemy/admin.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/builds/alchemy/alchemy_admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/assets/builds/alchemy/alchemy_admin.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/javascript/alchemy_admin/components/picture_thumbnail.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export default class PictureThumbnail extends HTMLElement {
4444
if (alt) {
4545
this.image.alt = alt
4646
}
47-
this.image.loading = "lazy"
4847
}
4948

5049
start(src) {

app/stylesheets/alchemy/admin/images.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
alchemy-picture-thumbnail {
22
&[loading] {
3-
img {
3+
> img {
44
opacity: 0;
55
}
66
}
77

8-
img {
8+
> img {
99
opacity: 1;
1010
transition: opacity var(--transition-duration);
1111
}

spec/javascript/alchemy_admin/components/picture_thumbnail.spec.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,6 @@ describe("alchemy-picture-thumbnail", () => {
152152
expect(element.image.alt).not.toBe("Test image")
153153
})
154154

155-
it("sets loading to lazy", () => {
156-
const element = renderComponent(
157-
"alchemy-picture-thumbnail",
158-
"<alchemy-picture-thumbnail></alchemy-picture-thumbnail>"
159-
)
160-
element.createImage("https://example.com/test.jpg")
161-
162-
expect(element.image.loading).toBe("lazy")
163-
})
164-
165155
it("uses default src from attribute", () => {
166156
const element = renderComponent(
167157
"alchemy-picture-thumbnail",

0 commit comments

Comments
 (0)