Skip to content

Commit

Permalink
🎨 #13978
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 4, 2025
1 parent aa43b29 commit dd42ff4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/src/protyle/gutter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ export class Gutter {
}
}
});
buttonElement.parentElement.querySelector("[data-type='fold'] > svg")?.setAttribute("style", `width: 10px${hasFold ? ";transform:rotate(90deg)" : ""}`);
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
Array.from(foldElement.children).forEach((ulElement) => {
Expand Down Expand Up @@ -353,7 +352,7 @@ export class Gutter {
}
}
});
buttonElement.parentElement.querySelector("[data-type='fold'] > svg")?.setAttribute("style", `width: 10px${hasFold ? ";transform:rotate(90deg)" : ""}`);
(buttonElement.parentElement.querySelector("[data-type='fold'] > svg") as HTMLElement).style.transform = hasFold ? "rotate(90deg)" : "";
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
Array.from(foldElement.parentElement.children).find((listItemElement) => {
Expand All @@ -378,7 +377,11 @@ export class Gutter {
});
transaction(protyle, doOperations, undoOperations);
} else {
setFold(protyle, foldElement);
const hasFold = setFold(protyle, foldElement);
const foldArrowElement = buttonElement.parentElement.querySelector("[data-type='fold'] > svg") as HTMLElement
if (hasFold !== -1 && foldArrowElement) {
foldArrowElement.style.transform = hasFold === 0 ? "rotate(90deg)" : "";
}
}
foldElement.classList.remove("protyle-wysiwyg--hl");
} else if (window.siyuan.shiftIsPressed && !protyle.disabled) {
Expand Down

0 comments on commit dd42ff4

Please sign in to comment.