Skip to content

Commit 5f36e69

Browse files
committed
fix thumbnail error tooltip position
hoist the tooltip when nested in a ingredient editor also make the surrounding smaller so that the hoverable area is just the icon and not the whole background (cherry picked from commit ef0934d)
1 parent fb67454 commit 5f36e69

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

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/javascript/alchemy_admin/components/picture_thumbnail.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ export default class PictureThumbnail extends HTMLElement {
7777

7878
#onError(evt) {
7979
const message = `Could not load ${this.image.src}`
80+
const hoist = this.closest(".ingredient-editor")
8081
this.spinner.stop()
8182
this.innerHTML = `
82-
<sl-tooltip content="${message}">
83+
<sl-tooltip content="${message}" ${hoist ? "hoist" : ""}>
8384
<alchemy-icon name="alert" class="error"></alchemy-icon>
8485
</sl-tooltip>
8586
`

app/stylesheets/alchemy/admin/archive.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ alchemy-uploader {
4949
text-decoration: none;
5050
}
5151

52-
alchemy-icon {
52+
alchemy-icon:not(.error) {
5353
display: flex;
5454
width: var(--picture-width);
5555
height: var(--picture-height);

app/stylesheets/alchemy/admin/icons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ alchemy-icon {
1212
}
1313

1414
&.error {
15-
padding: 2rem;
15+
padding: 0;
1616
}
1717
}
1818

0 commit comments

Comments
 (0)