From 31ec32ac98a4bcc878aa308beddf4549ff5c831a Mon Sep 17 00:00:00 2001 From: molon <3739161+molon@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:58:27 +0800 Subject: [PATCH] text-wrap for pre element --- activity/admin.go | 2 +- activity/timeline.go | 2 +- publish/status_compo.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/activity/admin.go b/activity/admin.go index f5755438d..e570c6645 100644 --- a/activity/admin.go +++ b/activity/admin.go @@ -355,7 +355,7 @@ func setupDetailing(dp *presets.DetailingBuilder, op *gorm2op.DataOperatorBuilde ), VCardText().Class("mt-3 pa-3 border-thin rounded").Children( h.Div().Class("d-flex flex-column").Children( - h.Pre(note.Note).Attr("v-pre", true).Class("text-body-2"), + h.Pre(note.Note).Attr("v-pre", true).Class("text-body-2 text-wrap"), h.Iff(!note.LastEditedAt.IsZero(), func() h.HTMLComponent { return h.Div().Class("text-caption font-italic").Style("color: #757575").Children( h.Text(msgr.LastEditedAt(pmsgr.HumanizeTime(note.LastEditedAt))), diff --git a/activity/timeline.go b/activity/timeline.go index 78fd6bb01..55bc48568 100644 --- a/activity/timeline.go +++ b/activity/timeline.go @@ -63,7 +63,7 @@ func (c *TimelineCompo) humanContent(ctx context.Context, log *ActivityLog) h.HT return h.Components( h.Div().Attr("v-if", "!xlocals.showEditBox").Class("d-flex flex-column").Children( h.Div(h.Text(msgr.AddedANote)), - h.Pre(note.Note).Attr("v-pre", true).Class("text-body-2"), + h.Pre(note.Note).Attr("v-pre", true).Class("text-body-2 text-wrap"), h.Iff(!note.LastEditedAt.IsZero(), func() h.HTMLComponent { return h.Div().Class("text-caption font-italic").Class("text-grey-darken-1").Children( h.Text(msgr.LastEditedAt(pmsgr.HumanizeTime(note.LastEditedAt))), diff --git a/publish/status_compo.go b/publish/status_compo.go index 3085b4892..b9965a8e1 100644 --- a/publish/status_compo.go +++ b/publish/status_compo.go @@ -114,7 +114,7 @@ func liveFunc(db *gorm.DB) presets.FieldComponentFunc { compo = h.Div().Class("d-flex").Children( h.Div().Children( VTooltip().Activator("parent").Location(LocationTop).Children( - h.Pre(tooltip).Attr("v-pre", true).Class("text-body-2"), + h.Pre(tooltip).Attr("v-pre", true).Class("text-body-2 text-wrap"), ), compo, ),