v2: header 标题超长时末尾省略号(文字包 span 可收缩)
This commit is contained in:
@@ -60,9 +60,14 @@ input, textarea { font: inherit; color: inherit; border: 0; outline: none; backg
|
|||||||
}
|
}
|
||||||
.header-title {
|
.header-title {
|
||||||
font-size: 15px; line-height: 1.3;
|
font-size: 15px; line-height: 1.3;
|
||||||
max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
min-width: 0; max-width: 100%; overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
display: flex; align-items: center; gap: 5px; justify-content: center;
|
display: flex; align-items: center; gap: 5px; justify-content: center;
|
||||||
}
|
}
|
||||||
|
/* 文字层可收缩,过长时末尾省略号(flex 容器本身不响应 text-overflow,须包 span) */
|
||||||
|
.header-title-text {
|
||||||
|
min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||||||
|
}
|
||||||
.header-mode-icon {
|
.header-mode-icon {
|
||||||
width: 17px; height: 17px; flex: none; color: var(--active);
|
width: 17px; height: 17px; flex: none; color: var(--active);
|
||||||
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
|
fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
|
||||||
|
|||||||
@@ -367,7 +367,8 @@
|
|||||||
title.className = 'header-title';
|
title.className = 'header-title';
|
||||||
title.style.cursor = 'pointer';
|
title.style.cursor = 'pointer';
|
||||||
title.title = '点击重命名';
|
title.title = '点击重命名';
|
||||||
title.innerHTML = (modeIcons[state.mode] || '') + esc(state.sessionTitle || state.sessionId);
|
title.innerHTML = (modeIcons[state.mode] || '') +
|
||||||
|
'<span class="header-title-text">' + esc(state.sessionTitle || state.sessionId) + '</span>';
|
||||||
title.addEventListener('click', renameSession); // 点标题重命名(同步 index)
|
title.addEventListener('click', renameSession); // 点标题重命名(同步 index)
|
||||||
c.innerHTML = '';
|
c.innerHTML = '';
|
||||||
c.appendChild(title);
|
c.appendChild(title);
|
||||||
|
|||||||
Reference in New Issue
Block a user