Skip to content

Commit 33eb1bd

Browse files
committed
fine tune
1 parent a1b5c51 commit 33eb1bd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

modules/templates/util_avatar.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func AvatarHTML(src string, size int, class, name string) template.HTML {
3434
name = "avatar"
3535
}
3636

37+
// use empty alt, otherwise if the image fails to load, the width will follow the "alt" text's width
3738
return template.HTML(`<img loading="lazy" alt="" class="` + class + `" src="` + src + `" title="` + html.EscapeString(name) + `" width="` + sizeStr + `" height="` + sizeStr + `"/>`)
3839
}
3940

web_src/js/modules/fomantic/dropdown.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ test('hideScopedEmptyDividers-simple', () => {
1515
expect(container.innerHTML).toEqual(`
1616
<div class="divider hidden transition"></div>
1717
<div class="item">a</div>
18-
<div class="divider"></div>
1918
<div class="divider hidden transition"></div>
2019
<div class="divider hidden transition"></div>
20+
<div class="divider"></div>
2121
<div class="item">b</div>
2222
<div class="divider hidden transition"></div>
2323
`);
@@ -35,10 +35,10 @@ test('hideScopedEmptyDividers-items-all-filtered', () => {
3535
hideScopedEmptyDividers(container);
3636
expect(container.innerHTML).toEqual(`
3737
<div class="any"></div>
38-
<div class="divider"></div>
38+
<div class="divider hidden transition"></div>
3939
<div class="item filtered">a</div>
4040
<div class="item filtered">b</div>
41-
<div class="divider hidden transition"></div>
41+
<div class="divider"></div>
4242
<div class="any"></div>
4343
`);
4444
});

web_src/js/modules/fomantic/dropdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export function hideScopedEmptyDividers(container: Element) {
341341
// no need to update "visibleItems" array since this is the last loop
342342
for (let i = 0; i < visibleItems.length - 1; i++) {
343343
if (!visibleItems[i].matches('.divider')) continue;
344-
if (visibleItems[i + 1].matches('.divider')) hideDivider(visibleItems[i + 1]);
344+
if (visibleItems[i + 1].matches('.divider')) hideDivider(visibleItems[i]);
345345
}
346346
}
347347

0 commit comments

Comments
 (0)