mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🚨
This commit is contained in:
parent
5b15802def
commit
cd9baa2b67
6 changed files with 17 additions and 17 deletions
|
|
@ -150,13 +150,13 @@ export class Files extends Model {
|
|||
});
|
||||
break;
|
||||
} else if (type === "toggle") {
|
||||
const svgElement = target.querySelector("svg")
|
||||
const svgElement = target.querySelector("svg");
|
||||
if (svgElement.classList.contains("b3-list-item__arrow--open")) {
|
||||
this.closeElement.style.height = "30px"
|
||||
this.closeElement.style.height = "30px";
|
||||
svgElement.classList.remove("b3-list-item__arrow--open");
|
||||
this.closeElement.lastElementChild.classList.add("fn__none");
|
||||
} else {
|
||||
this.closeElement.style.height = "40%"
|
||||
this.closeElement.style.height = "40%";
|
||||
svgElement.classList.add("b3-list-item__arrow--open");
|
||||
this.closeElement.lastElementChild.classList.remove("fn__none");
|
||||
}
|
||||
|
|
@ -775,7 +775,7 @@ export class Files extends Model {
|
|||
if (!init) {
|
||||
return;
|
||||
}
|
||||
const svgElement = this.closeElement.querySelector("svg")
|
||||
const svgElement = this.closeElement.querySelector("svg");
|
||||
if (html !== "") {
|
||||
this.closeElement.style.height = "30px";
|
||||
svgElement.classList.remove("b3-list-item__arrow--open");
|
||||
|
|
@ -954,9 +954,9 @@ export class Files extends Model {
|
|||
tempElement.innerHTML = fileHTML;
|
||||
// 保持文件夹展开状态
|
||||
nextElement.querySelectorAll(":scope > .b3-list-item > .b3-list-item__toggle> .b3-list-item__arrow--open").forEach(item => {
|
||||
const openLiElement = hasClosestByClassName(item, "b3-list-item")
|
||||
const openLiElement = hasClosestByClassName(item, "b3-list-item");
|
||||
if (openLiElement) {
|
||||
const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`)
|
||||
const tempOpenLiElement = tempElement.content.querySelector(`.b3-list-item[data-node-id="${openLiElement.getAttribute("data-node-id")}"]`);
|
||||
tempOpenLiElement.after(openLiElement.nextElementSibling);
|
||||
tempOpenLiElement.querySelector(".b3-list-item__arrow").classList.add("b3-list-item__arrow--open");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue