From 1cad605d4f672b8dd01a59ccb55526353e611242 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Thu, 9 Mar 2023 18:14:05 +0800 Subject: [PATCH] fix:hyperlink popup max width --- src/editor/assets/css/hyperlink/hyperlink.css | 14 ++++++++------ src/editor/core/draw/particle/HyperlinkParticle.ts | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/editor/assets/css/hyperlink/hyperlink.css b/src/editor/assets/css/hyperlink/hyperlink.css index 76c98bc..2b1caf6 100644 --- a/src/editor/assets/css/hyperlink/hyperlink.css +++ b/src/editor/assets/css/hyperlink/hyperlink.css @@ -1,13 +1,9 @@ .ce-hyperlink-popup { - min-width: 100px; - font-size: 12px; - line-height: 20px; background: #fff; box-shadow: 0 2px 12px 0 rgb(98 107 132 / 20%); border-radius: 2px; color: #3d4757; - padding: 16px; - white-space: nowrap; + padding: 12px 16px; position: absolute; z-index: 1; text-align: center; @@ -15,10 +11,16 @@ } .ce-hyperlink-popup a { + min-width: 100px; + max-width: 300px; + font-size: 12px; + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; cursor: pointer; text-decoration: none; border-bottom-width: 1px; border-bottom-style: solid; - padding-bottom: 2px; color: #0000ff; } \ No newline at end of file diff --git a/src/editor/core/draw/particle/HyperlinkParticle.ts b/src/editor/core/draw/particle/HyperlinkParticle.ts index cecb4cf..e2239d6 100644 --- a/src/editor/core/draw/particle/HyperlinkParticle.ts +++ b/src/editor/core/draw/particle/HyperlinkParticle.ts @@ -45,6 +45,7 @@ export class HyperlinkParticle { // 标签 const url = element.url || '#' this.hyperlinkDom.href = url + this.hyperlinkDom.title = url this.hyperlinkDom.innerText = url }