Skip to content
Snippets Groups Projects
Commit 65b57b3a authored by chris's avatar chris
Browse files

reset counter

parent d3635165
No related branches found
No related tags found
1 merge request!459Oen issues
......@@ -78,6 +78,9 @@ const captionPlugin = key =>
view.state.selection.$head.path[6].type.name === 'figcaption'
) {
counter += 1;
setTimeout(() => {
counter = 0;
}, 1500);
}
if (
......@@ -95,13 +98,13 @@ const captionPlugin = key =>
}
},
);
const figcap = document.getElementById(captionId);
const figCapEl = document.getElementById(captionId);
view.dispatch(
view.state.tr.setSelection(
NodeSelection.create(
view.state.doc,
view.posAtDOM(figcap.parentElement),
view.posAtDOM(figCapEl.parentElement),
),
),
);
......@@ -116,9 +119,7 @@ const captionPlugin = key =>
if (figCap[6] && figCap[6].type.name === 'figcaption') {
const figCapEl = document.getElementById(figCap[6].attrs.id);
if (
figCapEl.parentElement.firstChild.tagName === 'figCapElTION'
) {
if (figCapEl.parentElement.firstChild.tagName === 'FIGCAPTION') {
figCapEl.parentElement.remove();
}
}
......
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