From b51e99983d95f5ed074b8345bfa9fc8b88e9e9e7 Mon Sep 17 00:00:00 2001 From: shylinux Date: Wed, 29 Jul 2020 11:39:50 +0800 Subject: [PATCH] opt some --- core/chat/paste.go | 7 ++++--- misc.go | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/chat/paste.go b/core/chat/paste.go index 4bc184dc..74624c39 100644 --- a/core/chat/paste.go +++ b/core/chat/paste.go @@ -3,7 +3,6 @@ package chat import ( ice "github.com/shylinux/icebergs" "github.com/shylinux/icebergs/base/mdb" - "github.com/shylinux/icebergs/base/web" kit "github.com/shylinux/toolkits" "strings" @@ -79,12 +78,14 @@ func init() { if strings.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") { return } - m.Push("action", m.Cmdx(mdb.RENDER, web.RENDER.Button, "删除")) return } m.Push("detail", value) }) - m.Sort("time", "time_r") + if len(arg) == 0 { + m.PushAction("复制", "删除") + m.Sort("time", "time_r") + } }}, }, }, nil) diff --git a/misc.go b/misc.go index 44fe8f31..25b806b5 100644 --- a/misc.go +++ b/misc.go @@ -59,9 +59,11 @@ func (m *Message) AddCmd(cmd *Command) string { func (m *Message) PushAction(list ...interface{}) { m.Table(func(index int, value map[string]string, head []string) { + action := []string{} for _, k := range kit.Simple(list...) { - m.Push(k, m.Cmdx("render", "button", k)) + action = append(action, m.Cmdx("render", "button", k)) } + m.Push("操作", strings.Join(action, "")) }) } func (m *Message) PushDetail(value interface{}, arg ...interface{}) *Message {