mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
4e27798f53
commit
bbca5683ce
3 changed files with 4 additions and 6 deletions
|
|
@ -131,11 +131,11 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
transition: var(--b3-transition);
|
transition: var(--b3-transition);
|
||||||
flex: 1;
|
|
||||||
min-height: 42px;
|
min-height: 42px;
|
||||||
position: relative;
|
position: relative;
|
||||||
max-width: 186px;
|
max-width: 186px;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
&:hover:not(.item--focus):not(.item--readonly) .item__text {
|
&:hover:not(.item--focus):not(.item--readonly) .item__text {
|
||||||
color: var(--b3-theme-on-background);
|
color: var(--b3-theme-on-background);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ export class Tab {
|
||||||
this.headElement = document.createElement("li");
|
this.headElement = document.createElement("li");
|
||||||
this.headElement.setAttribute("data-type", "tab-header");
|
this.headElement.setAttribute("data-type", "tab-header");
|
||||||
this.headElement.setAttribute("draggable", "true");
|
this.headElement.setAttribute("draggable", "true");
|
||||||
this.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
|
this.headElement.setAttribute("style", "max-width: 0");
|
||||||
this.headElement.setAttribute("data-id", this.id);
|
this.headElement.setAttribute("data-id", this.id);
|
||||||
this.headElement.setAttribute("data-position", "center"); // showTooltip 位置标识
|
this.headElement.setAttribute("data-position", "center"); // showTooltip 位置标识
|
||||||
this.headElement.classList.add("item", "item--focus");
|
this.headElement.classList.add("item", "item--focus");
|
||||||
|
|
@ -40,9 +40,7 @@ export class Tab {
|
||||||
} else if (options.docIcon) {
|
} else if (options.docIcon) {
|
||||||
iconHTML = `<span class="item__icon">${unicode2Emoji(options.docIcon)}</span>`;
|
iconHTML = `<span class="item__icon">${unicode2Emoji(options.docIcon)}</span>`;
|
||||||
}
|
}
|
||||||
this.headElement.innerHTML = `<span class="fn__flex-1"></span>
|
this.headElement.innerHTML = `${iconHTML}<span class="item__text">${escapeHtml(options.title)}</span>
|
||||||
${iconHTML}<span class="item__text">${escapeHtml(options.title)}</span>
|
|
||||||
<span class="fn__flex-1"></span>
|
|
||||||
<span class="item__close"><svg><use xlink:href='#iconClose'></use></svg></span>`;
|
<span class="item__close"><svg><use xlink:href='#iconClose'></use></svg></span>`;
|
||||||
this.headElement.addEventListener("mouseenter", (event) => {
|
this.headElement.addEventListener("mouseenter", (event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -616,7 +616,7 @@ export class Wnd {
|
||||||
this.switchTab(this.children[currentIndex].headElement, true);
|
this.switchTab(this.children[currentIndex].headElement, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item.headElement.setAttribute("style", "flex: 0;width: 0;overflow: hidden");
|
item.headElement.setAttribute("style", "max-width: 0px;");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
item.headElement.remove();
|
item.headElement.remove();
|
||||||
}, Constants.TIMEOUT_TRANSITION);
|
}, Constants.TIMEOUT_TRANSITION);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue