From 7504ae84c33dee350e4504265b9cbde85cf27f52 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 8 Jul 2018 13:20:52 +0900 Subject: [PATCH] Added tooltips to edit interface images (closes #179) --- utils/editform/editform.go | 4 ++-- utils/editform/editform.pixy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/editform/editform.go b/utils/editform/editform.go index 49fe976c..4c195f83 100644 --- a/utils/editform/editform.go +++ b/utils/editform/editform.go @@ -214,7 +214,7 @@ func renderStringField(b *bytes.Buffer, v *reflect.Value, field reflect.StructFi anime, err := arn.GetAnime(animeID) if err == nil { - b.WriteString(components.EditFormImagePreview(anime.Link(), anime.ImageLink("small"), true)) + b.WriteString(components.EditFormImagePreview(anime.Link(), anime.ImageLink("small"), true, anime.Title.ByUser(nil))) } case "Character": @@ -222,7 +222,7 @@ func renderStringField(b *bytes.Buffer, v *reflect.Value, field reflect.StructFi character, err := arn.GetCharacter(characterID) if err == nil { - b.WriteString(components.EditFormImagePreview(character.Link(), character.ImageLink("medium"), false)) + b.WriteString(components.EditFormImagePreview(character.Link(), character.ImageLink("medium"), true, character.Name.ByUser(nil))) } case "": diff --git a/utils/editform/editform.pixy b/utils/editform/editform.pixy index ff4d8e93..29bf789c 100644 --- a/utils/editform/editform.pixy +++ b/utils/editform/editform.pixy @@ -1,3 +1,3 @@ -component EditFormImagePreview(link string, imageURL string, webp bool) - a(href=link, target="_blank") +component EditFormImagePreview(link string, imageURL string, webp bool, title string) + a.tip(href=link, target="_blank", aria-label=title) img.lazy(data-src=imageURL, alt="Preview", data-webp=webp) \ No newline at end of file