Skip to content
Snippets Groups Projects
Commit 2baa28a9 authored by chris's avatar chris
Browse files

tags fix

parent fb9962b1
No related branches found
No related tags found
1 merge request!287tags fix
...@@ -132,10 +132,6 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { ...@@ -132,10 +132,6 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => {
} }
}; };
const onSelectTag = val => {
item.run(state, dispatch, val.replace(/ /g, '-').toLowerCase());
};
const renderTagList = () => { const renderTagList = () => {
const tagList = []; const tagList = [];
const blockTags = allTags.filter(tag => { const blockTags = allTags.filter(tag => {
...@@ -147,11 +143,13 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => { ...@@ -147,11 +143,13 @@ const CustomTagBlockComponent = ({ isShowTag, item }) => {
<TagBoxWrapper key={uuidv4()}> <TagBoxWrapper key={uuidv4()}>
<Box key={uuidv4()} /> <Box key={uuidv4()} />
<StyledButton <StyledButton
active={JSON.parse(tagStatus[blockTag.label])} active={tagStatus[blockTag.label]}
disabled={isDisabled} disabled={isDisabled}
key={uuidv4()} key={uuidv4()}
label={blockTag.label} label={blockTag.label}
onMouseDown={() => onSelectTag(blockTag.label)} onMouseDown={() => {
item.run(activeView.state, activeView.dispatch, blockTag.label);
}}
title={blockTag.label} title={blockTag.label}
/> />
</TagBoxWrapper>, </TagBoxWrapper>,
......
...@@ -8,7 +8,7 @@ class CustomTagBlockTool extends Tools { ...@@ -8,7 +8,7 @@ class CustomTagBlockTool extends Tools {
get run() { get run() {
return (state, dispatch, val) => { return (state, dispatch, val) => {
Commands.setBlockType(state.config.schema.nodes.customTagBlock, { Commands.setBlockType(state.config.schema.nodes.customTagBlock, {
class: val, class: val.replace(/ /g, '-').toLowerCase(),
})(state, dispatch); })(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