mirror of
https://github.com/docmost/docmost.git
synced 2025-11-13 18:12:38 +10:00
fix toggle node in non-edit mode
This commit is contained in:
@ -111,6 +111,7 @@ export const Details = Node.create<DetailsOptions>({
|
|||||||
if (updatedNode.type !== this.type) {
|
if (updatedNode.type !== this.type) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!editor.isEditable) return true;
|
||||||
if (updatedNode.attrs.open) {
|
if (updatedNode.attrs.open) {
|
||||||
dom.setAttribute("open", "true");
|
dom.setAttribute("open", "true");
|
||||||
} else {
|
} else {
|
||||||
@ -133,7 +134,8 @@ export const Details = Node.create<DetailsOptions>({
|
|||||||
|
|
||||||
const slice = state.doc.slice(range.start, range.end);
|
const slice = state.doc.slice(range.start, range.end);
|
||||||
|
|
||||||
if(slice.content.firstChild.type.name === "detailsSummary") return false;
|
if (slice.content.firstChild.type.name === "detailsSummary")
|
||||||
|
return false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!state.schema.nodes.detailsContent.contentMatch.matchFragment(
|
!state.schema.nodes.detailsContent.contentMatch.matchFragment(
|
||||||
|
|||||||
Reference in New Issue
Block a user