Bugfix verifying list items block
This commit is contained in:
parent
36a344f34a
commit
2334862083
@ -51,7 +51,6 @@ export default class StylesMenu extends Component {
|
|||||||
return marks.some(mark => mark.type == type);
|
return marks.some(mark => mark.type == type);
|
||||||
}
|
}
|
||||||
hasBlock(type) {
|
hasBlock(type) {
|
||||||
console.log(type);
|
|
||||||
const { blocks } = this.props;
|
const { blocks } = this.props;
|
||||||
return blocks.some(node => node.type == type);
|
return blocks.some(node => node.type == type);
|
||||||
}
|
}
|
||||||
@ -78,8 +77,10 @@ export default class StylesMenu extends Component {
|
|||||||
this.props.onClickBlock(type, isActive, isList);
|
this.props.onClickBlock(type, isActive, isList);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBlockButton(type, icon) {
|
renderBlockButton(type, icon, checkType) {
|
||||||
const isActive = this.hasBlock(type);
|
checkType = checkType || type;
|
||||||
|
console.log(checkType)
|
||||||
|
const isActive = this.hasBlock(checkType);
|
||||||
const onMouseDown = e => this.handleBlockClick(e, type);
|
const onMouseDown = e => this.handleBlockClick(e, type);
|
||||||
return (
|
return (
|
||||||
<span className={styles.button} onMouseDown={onMouseDown} data-active={isActive}>
|
<span className={styles.button} onMouseDown={onMouseDown} data-active={isActive}>
|
||||||
@ -106,7 +107,7 @@ export default class StylesMenu extends Component {
|
|||||||
{this.renderBlockButton('heading1', 'h1')}
|
{this.renderBlockButton('heading1', 'h1')}
|
||||||
{this.renderBlockButton('heading2', 'h2')}
|
{this.renderBlockButton('heading2', 'h2')}
|
||||||
{this.renderBlockButton('block-quote', 'quote-left')}
|
{this.renderBlockButton('block-quote', 'quote-left')}
|
||||||
{this.renderBlockButton('bulleted-list', 'list-bullet')}
|
{this.renderBlockButton('bulleted-list', 'list-bullet', 'list-item')}
|
||||||
</div>
|
</div>
|
||||||
</Portal>
|
</Portal>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user