mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 06:23:06 +08:00
collapse by default in node-edit mode
This commit is contained in:
@@ -78,11 +78,14 @@ export const Details = Node.create<DetailsOptions>({
|
|||||||
dom.setAttribute("data-type", this.name);
|
dom.setAttribute("data-type", this.name);
|
||||||
btn.setAttribute("data-type", `${this.name}Button`);
|
btn.setAttribute("data-type", `${this.name}Button`);
|
||||||
div.setAttribute("data-type", `${this.name}Container`);
|
div.setAttribute("data-type", `${this.name}Container`);
|
||||||
|
|
||||||
|
if (editor.isEditable) {
|
||||||
if (node.attrs.open) {
|
if (node.attrs.open) {
|
||||||
dom.setAttribute("open", "true");
|
dom.setAttribute("open", "true");
|
||||||
} else {
|
} else {
|
||||||
dom.removeAttribute("open");
|
dom.removeAttribute("open");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ico.innerHTML = icon("right-line");
|
ico.innerHTML = icon("right-line");
|
||||||
btn.addEventListener("click", () => {
|
btn.addEventListener("click", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user