mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
UX: only toggle rich editor details on caret click (#32267)
This commit is contained in:
@ -69,7 +69,10 @@ const extension = {
|
|||||||
plugins: {
|
plugins: {
|
||||||
props: {
|
props: {
|
||||||
handleClickOn(view, pos, node, nodePos) {
|
handleClickOn(view, pos, node, nodePos) {
|
||||||
if (node.type.name === "summary") {
|
if (pos > 2 || node.type.name !== "summary") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
const details = view.state.doc.nodeAt(nodePos - 1);
|
const details = view.state.doc.nodeAt(nodePos - 1);
|
||||||
view.dispatch(
|
view.dispatch(
|
||||||
view.state.tr.setNodeMarkup(nodePos - 1, null, {
|
view.state.tr.setNodeMarkup(nodePos - 1, null, {
|
||||||
@ -77,7 +80,6 @@ const extension = {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user