Vanessa 2025-07-18 09:31:39 +08:00
parent d5d6095070
commit 6e838bb91a
2 changed files with 18 additions and 0 deletions

View file

@ -284,6 +284,22 @@ html {
overflow: hidden; overflow: hidden;
transition: var(--b3-transition); transition: var(--b3-transition);
} }
&.sy__file--disablehover {
.b3-list--background .b3-list-item {
&:hover {
background-color: transparent !important;
}
&--hide-action .b3-list-item__action {
display: none;
}
> * {
pointer-events: none;
}
}
}
} }
.counter { .counter {

View file

@ -428,6 +428,7 @@ export class Files extends Model {
hideTooltip(); hideTooltip();
const liElement = hasClosestByTag(event.target, "LI"); const liElement = hasClosestByTag(event.target, "LI");
if (liElement) { if (liElement) {
this.parent.panelElement.classList.add("sy__file--disablehover");
let selectElements: Element[] = Array.from(this.element.querySelectorAll(".b3-list-item--focus")); let selectElements: Element[] = Array.from(this.element.querySelectorAll(".b3-list-item--focus"));
if (!liElement.classList.contains("b3-list-item--focus")) { if (!liElement.classList.contains("b3-list-item--focus")) {
selectElements.forEach((item) => { selectElements.forEach((item) => {
@ -464,6 +465,7 @@ export class Files extends Model {
} }
}); });
this.element.addEventListener("dragend", () => { this.element.addEventListener("dragend", () => {
this.parent.panelElement.classList.remove("sy__file--disablehover");
this.element.querySelectorAll(".b3-list-item--focus").forEach((item: HTMLElement, index) => { this.element.querySelectorAll(".b3-list-item--focus").forEach((item: HTMLElement, index) => {
item.style.opacity = ""; item.style.opacity = "";
// https://github.com/siyuan-note/siyuan/issues/11587 // https://github.com/siyuan-note/siyuan/issues/11587