Skip to content
Snippets Groups Projects
Commit 52f1e432 authored by chris's avatar chris
Browse files

only check title text

parent 4ef0b1ac
No related branches found
No related tags found
1 merge request!252only check title text
import { emDash, ellipsis } from 'prosemirror-inputrules';
import { debounce } from 'lodash';
import { columnResizing, tableEditing } from 'prosemirror-tables';
import {
InlineAnnotationsService,
......@@ -54,9 +55,13 @@ import invisibles, {
paragraph,
} from '@guardian/prosemirror-invisibles';
const updateTitle = title => {
// const updateTitle = title => {
// console.log(title);
// };
const updateTitle = debounce(title => {
console.log(title);
};
}, 3000);
const saveTags = tags => {
// console.log(tags);
......
......@@ -31,13 +31,16 @@ const TitleButton = ({ view = {}, item }) => {
const serviceConfig = app.config.get('config.TitleService');
let chapterTitle = '';
if (titleNode[0]) chapterTitle = titleNode[0].node.textContent;
useEffect(() => {
if (titleNode[0]) {
serviceConfig.updateTitle(titleNode[0].node.textContent);
} else {
serviceConfig.updateTitle('');
}
}, [JSON.stringify(titleNode[0])]);
}, [chapterTitle]);
const isActive = !!active(state, activeViewId);
let isDisabled = !select(state, activeViewId, activeView);
......
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