Skip to content
Snippets Groups Projects
Commit 26d5f75c authored by chris's avatar chris
Browse files

expand comment

parent fdadc15b
No related branches found
No related tags found
1 merge request!160add track change plugin through service
......@@ -40,10 +40,18 @@ const getComment = state => {
});
});
if (allCommentsWithSameId.length > 1) {
const minPos = minBy(allCommentsWithSameId, 'pos');
const maxPos = maxBy(allCommentsWithSameId, 'pos');
const minPos = minBy(allCommentsWithSameId, 'pos');
const maxPos = maxBy(allCommentsWithSameId, 'pos');
if (
state.selection.from ===
maxPos.pos + last(allCommentsWithSameId).node.nodeSize
) {
state.schema.marks.comment.spec.inclusive = false;
} else {
state.schema.marks.comment.spec.inclusive = true;
}
if (allCommentsWithSameId.length > 1) {
return {
from: minPos.pos,
to: maxPos.pos + last(allCommentsWithSameId).node.nodeSize,
......
......@@ -13,6 +13,7 @@ class Emphasis extends Tools {
get run() {
return (state, dispatch) => {
console.log('run');
toggleMark(state.config.schema.marks.em)(state, dispatch);
};
}
......
......@@ -60,15 +60,6 @@ class ShortCuts {
}
pressEnter(state, dispatch) {
const commentMark = state.schema.marks.comment;
const commentOnSelection = DocumentHelpers.findFragmentedMark(
state,
commentMark,
);
if (commentOnSelection) {
state.schema.marks.comment.spec.inclusive = true;
}
// LISTS
if (splitListItem(this.schema.nodes.list_item)(state)) {
splitListItem(this.schema.nodes.list_item)(state, dispatch);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment